Skip to content

Commit 45f408a

Browse files
committed
fix: change default exports to named exports
1 parent 016a814 commit 45f408a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

src/validations/isAlphanumeric.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import { assertString } from '../helpers/assertString.ts';
22
import { alphanumeric } from '../helpers/alpha.ts';
33

4-
export default function isAlphanumeric(str: string, locale = 'en-US') {
4+
export const isAlphanumeric = (str: string, locale = 'en-US') => {
55
assertString(str);
66
if (locale in alphanumeric) {
77
return (alphanumeric as any)[locale].test(str);
88
}
99
throw new Error(`Invalid locale '${locale}'`);
10-
}
10+
};
1111

1212
export const alphanumericLocales = Object.keys(alphanumeric);

src/validations/isBase64.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const defaultBase64Options: Base64Options = {
1111
urlSafe: false,
1212
};
1313

14-
export default function isBase64(str: string, options?: Base64Options) {
14+
export const isBase64 = (str: string, options?: Base64Options) => {
1515
assertString(str);
1616
options = {
1717
...defaultBase64Options,
@@ -34,4 +34,4 @@ export default function isBase64(str: string, options?: Base64Options) {
3434
firstPaddingChar === len - 1 ||
3535
(firstPaddingChar === len - 2 && str[len - 1] === '=')
3636
);
37-
}
37+
};

src/validations/isFloat.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ type FloatOptions = {
1010
gt?: number;
1111
};
1212

13-
export default function isFloat(str: string, options?: FloatOptions) {
13+
export const isFloat = (str: string, options?: FloatOptions) => {
1414
assertString(str);
1515
options = options || {};
1616
const float = new RegExp(
@@ -31,6 +31,6 @@ export default function isFloat(str: string, options?: FloatOptions) {
3131
(!options.lt || value < options?.lt) &&
3232
(!options.gt || value > options?.gt)
3333
);
34-
}
34+
};
3535

3636
export const decimalLocales = Object.keys(decimal);

src/validations/isJWT.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { assertString } from '../helpers/assertString.ts';
2-
import isBase64 from './isBase64.ts';
2+
import { isBase64 } from './isBase64.ts';
33

44
export const isJWT = (str: string) => {
55
assertString(str);

0 commit comments

Comments
 (0)