Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
mesqueeb committed Feb 14, 2025
1 parent 9667b6a commit 79527e9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions dist/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export { isFullObject } from './isFullObject.js';
export { isFullString } from './isFullString.js';
export { isFunction } from './isFunction.js';
export type { AnyFunction } from './isFunction.js';
export { isHexDecimal } from './isHexDecimal.js';
export { isInstanceOf } from './isInstanceOf.js';
export { isIterable } from './isIterable.js';
export { isMap } from './isMap.js';
Expand Down
1 change: 1 addition & 0 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export { isFullArray } from './isFullArray.js';
export { isFullObject } from './isFullObject.js';
export { isFullString } from './isFullString.js';
export { isFunction } from './isFunction.js';
export { isHexDecimal } from './isHexDecimal.js';
export { isInstanceOf } from './isInstanceOf.js';
export { isIterable } from './isIterable.js';
export { isMap } from './isMap.js';
Expand Down
5 changes: 5 additions & 0 deletions dist/isHexDecimal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/**
* Checks if a string is a valid hexadecimal string. If a length is provided, it also checks that
* the string has that length.
*/
export declare function isHexDecimal(payload: unknown, length?: number): payload is string;
12 changes: 12 additions & 0 deletions dist/isHexDecimal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { isString } from './isString.js';
/**
* Checks if a string is a valid hexadecimal string. If a length is provided, it also checks that
* the string has that length.
*/
export function isHexDecimal(payload, length) {
if (!isString(payload))
return false;
if (!/^[0-9a-fA-F]+$/.test(payload))
return false;
return length === undefined || payload.length === length;
}

0 comments on commit 79527e9

Please sign in to comment.