valgen 7.0.0 → 7.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/constants.js +1 -1
- package/core/constants.d.ts +11 -0
- package/core/constants.js +11 -0
- package/core/context.d.ts +57 -0
- package/core/context.js +57 -0
- package/core/types.d.ts +40 -0
- package/core/utilities.d.ts +42 -2
- package/core/utilities.js +21 -1
- package/core/validation-error.d.ts +13 -0
- package/core/validation-error.js +13 -0
- package/core/validator.d.ts +100 -0
- package/core/validator.js +6 -0
- package/package.json +1 -1
- package/rules/format-rules/is-alpha.d.ts +10 -1
- package/rules/format-rules/is-alpha.js +10 -1
- package/rules/format-rules/is-alphanumeric.d.ts +10 -1
- package/rules/format-rules/is-alphanumeric.js +10 -1
- package/rules/format-rules/is-ascii.d.ts +10 -1
- package/rules/format-rules/is-ascii.js +10 -1
- package/rules/format-rules/is-base64.d.ts +20 -1
- package/rules/format-rules/is-base64.js +10 -1
- package/rules/format-rules/is-btc-address.d.ts +10 -1
- package/rules/format-rules/is-btc-address.js +10 -1
- package/rules/format-rules/is-credit-card.d.ts +16 -1
- package/rules/format-rules/is-credit-card.js +11 -1
- package/rules/format-rules/is-decimal.d.ts +12 -2
- package/rules/format-rules/is-decimal.js +12 -2
- package/rules/format-rules/is-ean.d.ts +11 -1
- package/rules/format-rules/is-ean.js +11 -1
- package/rules/format-rules/is-email.d.ts +19 -7
- package/rules/format-rules/is-email.js +13 -1
- package/rules/format-rules/is-eth-address.d.ts +10 -1
- package/rules/format-rules/is-eth-address.js +10 -1
- package/rules/format-rules/is-fqdn.d.ts +13 -2
- package/rules/format-rules/is-fqdn.js +12 -1
- package/rules/format-rules/is-hash.d.ts +17 -1
- package/rules/format-rules/is-hash.js +16 -1
- package/rules/format-rules/is-hex-color.d.ts +13 -1
- package/rules/format-rules/is-hex-color.js +13 -1
- package/rules/format-rules/is-hex.d.ts +13 -1
- package/rules/format-rules/is-hex.js +13 -1
- package/rules/format-rules/is-iban.d.ts +33 -2
- package/rules/format-rules/is-iban.js +19 -1
- package/rules/format-rules/is-ip.d.ts +44 -2
- package/rules/format-rules/is-ip.js +42 -2
- package/rules/format-rules/is-issn.d.ts +19 -2
- package/rules/format-rules/is-issn.js +18 -1
- package/rules/format-rules/is-jwt.d.ts +16 -1
- package/rules/format-rules/is-jwt.js +16 -1
- package/rules/format-rules/is-lowercase.d.ts +13 -1
- package/rules/format-rules/is-lowercase.js +13 -1
- package/rules/format-rules/is-mac-address.d.ts +19 -2
- package/rules/format-rules/is-mac-address.js +16 -1
- package/rules/format-rules/is-mobile-phone.d.ts +19 -3
- package/rules/format-rules/is-mobile-phone.js +17 -1
- package/rules/format-rules/is-object-id.d.ts +20 -1
- package/rules/format-rules/is-object-id.js +19 -1
- package/rules/format-rules/is-passport-number.d.ts +17 -1
- package/rules/format-rules/is-passport-number.js +17 -1
- package/rules/format-rules/is-port.d.ts +16 -1
- package/rules/format-rules/is-port.js +16 -1
- package/rules/format-rules/is-swift.d.ts +15 -1
- package/rules/format-rules/is-swift.js +15 -1
- package/rules/format-rules/is-time.d.ts +22 -1
- package/rules/format-rules/is-time.js +22 -1
- package/rules/format-rules/is-uppercase.d.ts +15 -1
- package/rules/format-rules/is-uppercase.js +15 -1
- package/rules/format-rules/is-url.d.ts +99 -1
- package/rules/format-rules/is-url.js +19 -1
- package/rules/format-rules/is-uuid.d.ts +23 -1
- package/rules/format-rules/is-uuid.js +23 -1
- package/rules/format-rules/is-vat-number.d.ts +19 -2
- package/rules/format-rules/is-vat-number.js +19 -2
- package/rules/format-rules/matches.d.ts +27 -1
- package/rules/format-rules/matches.js +23 -1
- package/rules/logical-rules/is-defined.d.ts +14 -2
- package/rules/logical-rules/is-defined.js +13 -2
- package/rules/logical-rules/is-empty.d.ts +40 -2
- package/rules/logical-rules/is-empty.js +38 -2
- package/rules/logical-rules/is-equal.d.ts +31 -4
- package/rules/logical-rules/is-equal.js +29 -4
- package/rules/logical-rules/is-gt.d.ts +26 -1
- package/rules/logical-rules/is-gt.js +20 -1
- package/rules/logical-rules/is-gte.d.ts +25 -1
- package/rules/logical-rules/is-gte.js +20 -1
- package/rules/logical-rules/is-lt.d.ts +24 -1
- package/rules/logical-rules/is-lt.js +19 -1
- package/rules/logical-rules/is-lte.d.ts +25 -1
- package/rules/logical-rules/is-lte.js +20 -1
- package/rules/logical-rules/length.d.ts +38 -2
- package/rules/logical-rules/length.js +38 -2
- package/rules/logical-rules/range.d.ts +25 -1
- package/rules/logical-rules/range.js +23 -1
- package/rules/type-rules/is-any.d.ts +12 -1
- package/rules/type-rules/is-any.js +12 -1
- package/rules/type-rules/is-array.d.ts +23 -2
- package/rules/type-rules/is-array.js +23 -2
- package/rules/type-rules/is-bigint.d.ts +14 -2
- package/rules/type-rules/is-bigint.js +14 -2
- package/rules/type-rules/is-boolean.d.ts +17 -2
- package/rules/type-rules/is-boolean.js +17 -2
- package/rules/type-rules/is-date.d.ts +47 -5
- package/rules/type-rules/is-date.js +42 -5
- package/rules/type-rules/is-enum.d.ts +23 -1
- package/rules/type-rules/is-enum.js +21 -1
- package/rules/type-rules/is-instanceof.d.ts +21 -1
- package/rules/type-rules/is-instanceof.js +21 -1
- package/rules/type-rules/is-integer.d.ts +17 -2
- package/rules/type-rules/is-integer.js +17 -2
- package/rules/type-rules/is-null.d.ts +51 -4
- package/rules/type-rules/is-null.js +51 -4
- package/rules/type-rules/is-number.d.ts +17 -2
- package/rules/type-rules/is-number.js +17 -2
- package/rules/type-rules/is-object.d.ts +45 -7
- package/rules/type-rules/is-object.js +40 -7
- package/rules/type-rules/is-record.d.ts +21 -2
- package/rules/type-rules/is-record.js +21 -2
- package/rules/type-rules/is-string.d.ts +16 -2
- package/rules/type-rules/is-string.js +16 -2
- package/rules/type-rules/is-tuple.d.ts +21 -2
- package/rules/type-rules/is-undefined.d.ts +16 -4
- package/rules/type-rules/is-undefined.js +16 -4
- package/rules/utility-rules/all-of.d.ts +28 -1
- package/rules/utility-rules/all-of.js +27 -1
- package/rules/utility-rules/exists.d.ts +30 -1
- package/rules/utility-rules/exists.js +29 -1
- package/rules/utility-rules/fixed.d.ts +19 -1
- package/rules/utility-rules/fixed.js +19 -1
- package/rules/utility-rules/get-length.d.ts +25 -2
- package/rules/utility-rules/get-length.js +25 -2
- package/rules/utility-rules/nullable.d.ts +28 -1
- package/rules/utility-rules/nullable.js +27 -1
- package/rules/utility-rules/one-of.d.ts +52 -3
- package/rules/utility-rules/one-of.js +81 -9
- package/rules/utility-rules/optional.d.ts +29 -1
- package/rules/utility-rules/optional.js +28 -1
- package/rules/utility-rules/pipe.d.ts +38 -1
- package/rules/utility-rules/pipe.js +30 -1
- package/rules/utility-rules/required.d.ts +39 -1
- package/rules/utility-rules/required.js +32 -1
- package/rules/utility-rules/string-utils.d.ts +99 -5
- package/rules/utility-rules/string-utils.js +53 -3
|
@@ -1,18 +1,60 @@
|
|
|
1
1
|
import { type IPVersion as _IPVersion } from '@browsery/validator';
|
|
2
2
|
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is a valid IP address (v4 or v6). Delegates to
|
|
5
|
+
* `validatorJS.isIP(input, version)`. Without a version, either IPv4 or IPv6
|
|
6
|
+
* is accepted; with a version, only that version passes.
|
|
5
7
|
* @validator isIP
|
|
8
|
+
* @param version - Restricts validation to `'4'`/`4` or `'6'`/`6`; omit to
|
|
9
|
+
* accept either version.
|
|
10
|
+
* @param options - Validation options.
|
|
11
|
+
* @returns The validated IP address string, unchanged.
|
|
12
|
+
* @throws `Value must be a valid IP` (or `Value must be a valid IP v${version}`
|
|
13
|
+
* when `version` is given) when the input is not a string, or is not a
|
|
14
|
+
* valid IP address of the requested version.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { isIP, vg } from 'valgen';
|
|
18
|
+
*
|
|
19
|
+
* isIP('192.168.1.1'); // => '192.168.1.1'
|
|
20
|
+
* isIP('not-an-ip'); // throws ValidationError: "Value must be a valid IP"
|
|
21
|
+
*
|
|
22
|
+
* const isIPv4 = vg.isIP(4);
|
|
23
|
+
* isIPv4('10.0.0.1'); // => '10.0.0.1'
|
|
24
|
+
* isIPv4('2001:db8::1'); // throws ValidationError: "Value must be a valid IP v4"
|
|
25
|
+
* ```
|
|
6
26
|
*/
|
|
7
27
|
export declare function isIP(version?: isIP.IPVersion, options?: ValidationOptions): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
8
28
|
/**
|
|
9
|
-
* Validates
|
|
29
|
+
* Validates that a string is a valid IP address range in CIDR notation (v4
|
|
30
|
+
* or v6). Delegates to `validatorJS.isIPRange(input, version)`, requiring a
|
|
31
|
+
* `/`-delimited subnet mask.
|
|
10
32
|
* @validator isIPRange
|
|
33
|
+
* @param version - Restricts validation to `'4'`/`4` or `'6'`/`6`; omit to
|
|
34
|
+
* accept either version.
|
|
35
|
+
* @param options - Validation options.
|
|
36
|
+
* @returns The validated CIDR range string, unchanged.
|
|
37
|
+
* @throws `Value must be a valid IP range` (or `Value must be a valid IP
|
|
38
|
+
* v${version} range` when `version` is given) when the input is not a
|
|
39
|
+
* string, or is not a valid CIDR range of the requested version (e.g. a
|
|
40
|
+
* missing subnet mask).
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { isIPRange, vg } from 'valgen';
|
|
44
|
+
*
|
|
45
|
+
* isIPRange('192.168.1.0/24'); // => '192.168.1.0/24'
|
|
46
|
+
* isIPRange('192.168.1.0'); // throws ValidationError: "Value must be a valid IP range"
|
|
47
|
+
*
|
|
48
|
+
* const isIPv4Range = vg.isIPRange(4);
|
|
49
|
+
* isIPv4Range('192.168.1.0/24'); // => '192.168.1.0/24'
|
|
50
|
+
* ```
|
|
11
51
|
*/
|
|
12
52
|
export declare function isIPRange(version?: isIPRange.IPVersion, options?: ValidationOptions): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
13
53
|
export declare namespace isIP {
|
|
54
|
+
/** The IP versions accepted by {@link isIP}'s `version` argument. */
|
|
14
55
|
type IPVersion = _IPVersion;
|
|
15
56
|
}
|
|
16
57
|
export declare namespace isIPRange {
|
|
58
|
+
/** The IP versions accepted by {@link isIPRange}'s `version` argument. */
|
|
17
59
|
type IPVersion = _IPVersion;
|
|
18
60
|
}
|
|
@@ -2,8 +2,28 @@ import validatorJS, {} from '@browsery/validator';
|
|
|
2
2
|
import {} from 'ts-gems';
|
|
3
3
|
import { validator, } from '../../core/index.js';
|
|
4
4
|
/**
|
|
5
|
-
* Validates
|
|
5
|
+
* Validates that a string is a valid IP address (v4 or v6). Delegates to
|
|
6
|
+
* `validatorJS.isIP(input, version)`. Without a version, either IPv4 or IPv6
|
|
7
|
+
* is accepted; with a version, only that version passes.
|
|
6
8
|
* @validator isIP
|
|
9
|
+
* @param version - Restricts validation to `'4'`/`4` or `'6'`/`6`; omit to
|
|
10
|
+
* accept either version.
|
|
11
|
+
* @param options - Validation options.
|
|
12
|
+
* @returns The validated IP address string, unchanged.
|
|
13
|
+
* @throws `Value must be a valid IP` (or `Value must be a valid IP v${version}`
|
|
14
|
+
* when `version` is given) when the input is not a string, or is not a
|
|
15
|
+
* valid IP address of the requested version.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { isIP, vg } from 'valgen';
|
|
19
|
+
*
|
|
20
|
+
* isIP('192.168.1.1'); // => '192.168.1.1'
|
|
21
|
+
* isIP('not-an-ip'); // throws ValidationError: "Value must be a valid IP"
|
|
22
|
+
*
|
|
23
|
+
* const isIPv4 = vg.isIP(4);
|
|
24
|
+
* isIPv4('10.0.0.1'); // => '10.0.0.1'
|
|
25
|
+
* isIPv4('2001:db8::1'); // throws ValidationError: "Value must be a valid IP v4"
|
|
26
|
+
* ```
|
|
7
27
|
*/
|
|
8
28
|
export function isIP(version, options) {
|
|
9
29
|
return validator(isIP.name, (input, context, _this) => {
|
|
@@ -16,8 +36,28 @@ export function isIP(version, options) {
|
|
|
16
36
|
}, options);
|
|
17
37
|
}
|
|
18
38
|
/**
|
|
19
|
-
* Validates
|
|
39
|
+
* Validates that a string is a valid IP address range in CIDR notation (v4
|
|
40
|
+
* or v6). Delegates to `validatorJS.isIPRange(input, version)`, requiring a
|
|
41
|
+
* `/`-delimited subnet mask.
|
|
20
42
|
* @validator isIPRange
|
|
43
|
+
* @param version - Restricts validation to `'4'`/`4` or `'6'`/`6`; omit to
|
|
44
|
+
* accept either version.
|
|
45
|
+
* @param options - Validation options.
|
|
46
|
+
* @returns The validated CIDR range string, unchanged.
|
|
47
|
+
* @throws `Value must be a valid IP range` (or `Value must be a valid IP
|
|
48
|
+
* v${version} range` when `version` is given) when the input is not a
|
|
49
|
+
* string, or is not a valid CIDR range of the requested version (e.g. a
|
|
50
|
+
* missing subnet mask).
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* import { isIPRange, vg } from 'valgen';
|
|
54
|
+
*
|
|
55
|
+
* isIPRange('192.168.1.0/24'); // => '192.168.1.0/24'
|
|
56
|
+
* isIPRange('192.168.1.0'); // throws ValidationError: "Value must be a valid IP range"
|
|
57
|
+
*
|
|
58
|
+
* const isIPv4Range = vg.isIPRange(4);
|
|
59
|
+
* isIPv4Range('192.168.1.0/24'); // => '192.168.1.0/24'
|
|
60
|
+
* ```
|
|
21
61
|
*/
|
|
22
62
|
export function isIPRange(version, options) {
|
|
23
63
|
return validator(isIPRange.name, (input, context, _this) => {
|
|
@@ -1,7 +1,24 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a string is a valid ISSN (International Standard Serial
|
|
4
|
+
* Number). Delegates to `validatorJS.isISSN(input, { case_sensitive })`.
|
|
4
5
|
* @validator isISSN
|
|
6
|
+
* @param options - Validation options.
|
|
7
|
+
* @returns The validated ISSN string, unchanged.
|
|
8
|
+
* @throws `Value must be a valid ISSN` when the input is not a string, is
|
|
9
|
+
* not a valid ISSN, or (with `caseSensitive: true`) has a lowercase `x`
|
|
10
|
+
* check digit.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { isISSN, vg } from 'valgen';
|
|
14
|
+
*
|
|
15
|
+
* isISSN('0378-5955'); // => '0378-5955'
|
|
16
|
+
* isISSN('1234-1234'); // throws ValidationError: "Value must be a valid ISSN"
|
|
17
|
+
*
|
|
18
|
+
* isISSN('1000-002x'); // => '1000-002x' (lowercase check digit allowed by default)
|
|
19
|
+
* const strict = vg.isISSN({ caseSensitive: true });
|
|
20
|
+
* strict('1000-002x'); // throws ValidationError: "Value must be a valid ISSN"
|
|
21
|
+
* ```
|
|
5
22
|
*/
|
|
6
23
|
export declare function isISSN(options?: isISSN.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
7
24
|
export declare namespace isISSN {
|
|
@@ -9,7 +26,7 @@ export declare namespace isISSN {
|
|
|
9
26
|
/**
|
|
10
27
|
* If set to `true`, ISSNs with a lowercase `x` as the check digit are rejected.
|
|
11
28
|
*
|
|
12
|
-
* @
|
|
29
|
+
* @defaultValue false
|
|
13
30
|
*/
|
|
14
31
|
caseSensitive?: boolean;
|
|
15
32
|
}
|
|
@@ -1,8 +1,25 @@
|
|
|
1
1
|
import validatorJS, {} from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is a valid ISSN (International Standard Serial
|
|
5
|
+
* Number). Delegates to `validatorJS.isISSN(input, { case_sensitive })`.
|
|
5
6
|
* @validator isISSN
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated ISSN string, unchanged.
|
|
9
|
+
* @throws `Value must be a valid ISSN` when the input is not a string, is
|
|
10
|
+
* not a valid ISSN, or (with `caseSensitive: true`) has a lowercase `x`
|
|
11
|
+
* check digit.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { isISSN, vg } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* isISSN('0378-5955'); // => '0378-5955'
|
|
17
|
+
* isISSN('1234-1234'); // throws ValidationError: "Value must be a valid ISSN"
|
|
18
|
+
*
|
|
19
|
+
* isISSN('1000-002x'); // => '1000-002x' (lowercase check digit allowed by default)
|
|
20
|
+
* const strict = vg.isISSN({ caseSensitive: true });
|
|
21
|
+
* strict('1000-002x'); // throws ValidationError: "Value must be a valid ISSN"
|
|
22
|
+
* ```
|
|
6
23
|
*/
|
|
7
24
|
export function isISSN(options) {
|
|
8
25
|
const opts = {
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a string is structurally a valid JWT (JSON Web Token).
|
|
4
|
+
* Delegates to `validatorJS.isJWT(input)`, which checks for three base64url
|
|
5
|
+
* segments separated by `.` (it does not verify a signature).
|
|
4
6
|
* @validator isJWT
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated JWT string, unchanged.
|
|
9
|
+
* @throws `Value must be valid JWT token` when the input is not a string, or
|
|
10
|
+
* does not have the three-segment base64url structure of a JWT.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { isJWT } from 'valgen';
|
|
14
|
+
*
|
|
15
|
+
* const jwt =
|
|
16
|
+
* 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U';
|
|
17
|
+
* isJWT(jwt); // => jwt
|
|
18
|
+
* isJWT('abc.def'); // throws ValidationError: "Value must be valid JWT token"
|
|
19
|
+
* ```
|
|
5
20
|
*/
|
|
6
21
|
export declare function isJWT(options?: isJWT.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
7
22
|
export declare namespace isJWT {
|
|
@@ -1,8 +1,23 @@
|
|
|
1
1
|
import validatorJS from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is structurally a valid JWT (JSON Web Token).
|
|
5
|
+
* Delegates to `validatorJS.isJWT(input)`, which checks for three base64url
|
|
6
|
+
* segments separated by `.` (it does not verify a signature).
|
|
5
7
|
* @validator isJWT
|
|
8
|
+
* @param options - Validation options.
|
|
9
|
+
* @returns The validated JWT string, unchanged.
|
|
10
|
+
* @throws `Value must be valid JWT token` when the input is not a string, or
|
|
11
|
+
* does not have the three-segment base64url structure of a JWT.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { isJWT } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* const jwt =
|
|
17
|
+
* 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIn0.dozjgNryP4J3jVmNHl0w5N_XgL0n3I9PlFUP0THsR8U';
|
|
18
|
+
* isJWT(jwt); // => jwt
|
|
19
|
+
* isJWT('abc.def'); // throws ValidationError: "Value must be valid JWT token"
|
|
20
|
+
* ```
|
|
6
21
|
*/
|
|
7
22
|
export function isJWT(options) {
|
|
8
23
|
return validator(isJWT.name, (input, context, _this) => {
|
|
@@ -1,7 +1,19 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a string contains only lowercase characters. Delegates to
|
|
4
|
+
* `validatorJS.isLowercase(input)`.
|
|
4
5
|
* @validator isLowercase
|
|
6
|
+
* @param options - Validation options.
|
|
7
|
+
* @returns The validated lowercase string, unchanged.
|
|
8
|
+
* @throws `Value must be a lowercase string` when the input is not a
|
|
9
|
+
* string, or contains any non-lowercase characters.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { isLowercase } from 'valgen';
|
|
13
|
+
*
|
|
14
|
+
* isLowercase('abc'); // => 'abc'
|
|
15
|
+
* isLowercase('ABC'); // throws ValidationError: "Value must be a lowercase string"
|
|
16
|
+
* ```
|
|
5
17
|
*/
|
|
6
18
|
export declare function isLowercase(options?: isLowercase.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
7
19
|
export declare namespace isLowercase {
|
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import validatorJS from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string contains only lowercase characters. Delegates to
|
|
5
|
+
* `validatorJS.isLowercase(input)`.
|
|
5
6
|
* @validator isLowercase
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated lowercase string, unchanged.
|
|
9
|
+
* @throws `Value must be a lowercase string` when the input is not a
|
|
10
|
+
* string, or contains any non-lowercase characters.
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { isLowercase } from 'valgen';
|
|
14
|
+
*
|
|
15
|
+
* isLowercase('abc'); // => 'abc'
|
|
16
|
+
* isLowercase('ABC'); // throws ValidationError: "Value must be a lowercase string"
|
|
17
|
+
* ```
|
|
6
18
|
*/
|
|
7
19
|
export function isLowercase(options) {
|
|
8
20
|
return validator(isLowercase.name, (input, context, _this) => {
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a string is a valid MAC address. Delegates to
|
|
4
|
+
* `validatorJS.isMACAddress(input, { no_separators, eui })`.
|
|
4
5
|
* @validator isMACAddress
|
|
6
|
+
* @param options - Validation options.
|
|
7
|
+
* @returns The validated MAC address string, unchanged.
|
|
8
|
+
* @throws `Value must be a valid MAC address` when the input is not a
|
|
9
|
+
* string, or does not match the requested MAC address format.
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* import { isMACAddress, vg } from 'valgen';
|
|
13
|
+
*
|
|
14
|
+
* isMACAddress('01:02:03:04:05:ab'); // => '01:02:03:04:05:ab'
|
|
15
|
+
* isMACAddress('0102030405ab'); // throws ValidationError: "Value must be a valid MAC address"
|
|
16
|
+
*
|
|
17
|
+
* const noSeparators = vg.isMACAddress({ noSeparators: true });
|
|
18
|
+
* noSeparators('0102030405ab'); // => '0102030405ab'
|
|
19
|
+
* ```
|
|
5
20
|
*/
|
|
6
21
|
export declare function isMACAddress(options?: isMACAddress.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
7
22
|
export declare namespace isMACAddress {
|
|
@@ -12,11 +27,13 @@ export declare namespace isMACAddress {
|
|
|
12
27
|
*
|
|
13
28
|
* e.g. `01 02 03 04 05 ab` or `01-02-03-04-05-ab`.
|
|
14
29
|
*
|
|
15
|
-
* @
|
|
30
|
+
* @defaultValue false
|
|
16
31
|
*/
|
|
17
32
|
noSeparators?: boolean;
|
|
18
33
|
/**
|
|
19
34
|
* Setting `eui` allows for validation against EUI-48 or EUI-64 instead of both.
|
|
35
|
+
*
|
|
36
|
+
* @defaultValue undefined
|
|
20
37
|
*/
|
|
21
38
|
eui?: '48' | '64';
|
|
22
39
|
}
|
|
@@ -2,8 +2,23 @@ import validatorJS, {} from '@browsery/validator';
|
|
|
2
2
|
import {} from 'ts-gems';
|
|
3
3
|
import { validator, } from '../../core/index.js';
|
|
4
4
|
/**
|
|
5
|
-
* Validates
|
|
5
|
+
* Validates that a string is a valid MAC address. Delegates to
|
|
6
|
+
* `validatorJS.isMACAddress(input, { no_separators, eui })`.
|
|
6
7
|
* @validator isMACAddress
|
|
8
|
+
* @param options - Validation options.
|
|
9
|
+
* @returns The validated MAC address string, unchanged.
|
|
10
|
+
* @throws `Value must be a valid MAC address` when the input is not a
|
|
11
|
+
* string, or does not match the requested MAC address format.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { isMACAddress, vg } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* isMACAddress('01:02:03:04:05:ab'); // => '01:02:03:04:05:ab'
|
|
17
|
+
* isMACAddress('0102030405ab'); // throws ValidationError: "Value must be a valid MAC address"
|
|
18
|
+
*
|
|
19
|
+
* const noSeparators = vg.isMACAddress({ noSeparators: true });
|
|
20
|
+
* noSeparators('0102030405ab'); // => '0102030405ab'
|
|
21
|
+
* ```
|
|
7
22
|
*/
|
|
8
23
|
export function isMACAddress(options) {
|
|
9
24
|
const opts = {
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import { type MobilePhoneLocale as _MobilePhoneLocale } from '@browsery/validator';
|
|
2
2
|
import { type ValidationOptions } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is a valid mobile phone number. Delegates to
|
|
5
|
+
* `validatorJS.isMobilePhone(input, options.locale, { strictMode })`.
|
|
5
6
|
* @validator isMobilePhone
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated mobile phone number string, unchanged.
|
|
9
|
+
* @throws `Value must be a valid Mobile Phone Number` when the input is not
|
|
10
|
+
* a string, or is not a valid mobile phone number for the requested
|
|
11
|
+
* locale(s)/strictness.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { isMobilePhone, vg } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* isMobilePhone('+14155552671'); // => '+14155552671'
|
|
17
|
+
* isMobilePhone('12345'); // throws ValidationError: "Value must be a valid Mobile Phone Number"
|
|
18
|
+
*
|
|
19
|
+
* const trStrict = vg.isMobilePhone({ locale: 'tr-TR', strictMode: true });
|
|
20
|
+
* trStrict('+905321234567'); // => '+905321234567'
|
|
21
|
+
* ```
|
|
6
22
|
*/
|
|
7
23
|
export declare function isMobilePhone(options?: isMobilePhone.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
8
24
|
export declare namespace isMobilePhone {
|
|
@@ -10,12 +26,12 @@ export declare namespace isMobilePhone {
|
|
|
10
26
|
/**
|
|
11
27
|
* If this is set to `true`, the mobile phone number must be supplied with the country code and therefore must start with `+`.
|
|
12
28
|
*
|
|
13
|
-
* @
|
|
29
|
+
* @defaultValue false
|
|
14
30
|
*/
|
|
15
31
|
strictMode?: boolean;
|
|
16
32
|
/**
|
|
17
33
|
* Locale or locales of the mobile phone
|
|
18
|
-
* @
|
|
34
|
+
* @defaultValue 'any'
|
|
19
35
|
*/
|
|
20
36
|
locale?: 'any' | MobilePhoneLocale | MobilePhoneLocale[];
|
|
21
37
|
}
|
|
@@ -1,8 +1,24 @@
|
|
|
1
1
|
import validatorJS, {} from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is a valid mobile phone number. Delegates to
|
|
5
|
+
* `validatorJS.isMobilePhone(input, options.locale, { strictMode })`.
|
|
5
6
|
* @validator isMobilePhone
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated mobile phone number string, unchanged.
|
|
9
|
+
* @throws `Value must be a valid Mobile Phone Number` when the input is not
|
|
10
|
+
* a string, or is not a valid mobile phone number for the requested
|
|
11
|
+
* locale(s)/strictness.
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { isMobilePhone, vg } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* isMobilePhone('+14155552671'); // => '+14155552671'
|
|
17
|
+
* isMobilePhone('12345'); // throws ValidationError: "Value must be a valid Mobile Phone Number"
|
|
18
|
+
*
|
|
19
|
+
* const trStrict = vg.isMobilePhone({ locale: 'tr-TR', strictMode: true });
|
|
20
|
+
* trStrict('+905321234567'); // => '+905321234567'
|
|
21
|
+
* ```
|
|
6
22
|
*/
|
|
7
23
|
export function isMobilePhone(options) {
|
|
8
24
|
const opts = {
|
|
@@ -1,10 +1,29 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a value is a valid MongoDB `ObjectId` (a 24-char hex
|
|
4
|
+
* string, a 12-byte `Uint8Array`, or an object exposing `toHexString()`).
|
|
5
|
+
* Unlike most format rules, this is not a wrapper around
|
|
6
|
+
* `@browsery/validator`'s own `isObjectId` - it implements its own check,
|
|
7
|
+
* using `validatorJS.isHexadecimal` only for the string case.
|
|
4
8
|
* @validator isObjectId
|
|
9
|
+
* @param options - Validation options.
|
|
10
|
+
* @returns The validated value, unchanged (its original type - string,
|
|
11
|
+
* `Uint8Array`, or `ObjectIdLike`).
|
|
12
|
+
* @throws `Value must be a valid ObjectId` when the input is not a
|
|
13
|
+
* 24-character hex string, a 12-byte `Uint8Array`, or an object whose
|
|
14
|
+
* `toHexString()` result passes the same check.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* import { isObjectId } from 'valgen';
|
|
18
|
+
*
|
|
19
|
+
* const idString = '64897efbdf01a60ac1b678ea';
|
|
20
|
+
* isObjectId(idString); // => '64897efbdf01a60ac1b678ea'
|
|
21
|
+
* isObjectId(undefined); // throws ValidationError: "Value must be a valid ObjectId"
|
|
22
|
+
* ```
|
|
5
23
|
*/
|
|
6
24
|
export declare function isObjectId(options?: ValidationOptions): import("../../core/validator.js").Validator<string | Uint8Array<ArrayBufferLike> | isObjectId.ObjectIdLike, unknown, import("../../core/types.js").ExecutionOptions>;
|
|
7
25
|
export declare namespace isObjectId {
|
|
26
|
+
/** An object exposing a MongoDB-style `toHexString()` method, accepted as input alongside plain hex strings and 12-byte `Uint8Array`s. */
|
|
8
27
|
interface ObjectIdLike {
|
|
9
28
|
id: string | Uint8Array;
|
|
10
29
|
toHexString(): string;
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
import validatorJS from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a value is a valid MongoDB `ObjectId` (a 24-char hex
|
|
5
|
+
* string, a 12-byte `Uint8Array`, or an object exposing `toHexString()`).
|
|
6
|
+
* Unlike most format rules, this is not a wrapper around
|
|
7
|
+
* `@browsery/validator`'s own `isObjectId` - it implements its own check,
|
|
8
|
+
* using `validatorJS.isHexadecimal` only for the string case.
|
|
5
9
|
* @validator isObjectId
|
|
10
|
+
* @param options - Validation options.
|
|
11
|
+
* @returns The validated value, unchanged (its original type - string,
|
|
12
|
+
* `Uint8Array`, or `ObjectIdLike`).
|
|
13
|
+
* @throws `Value must be a valid ObjectId` when the input is not a
|
|
14
|
+
* 24-character hex string, a 12-byte `Uint8Array`, or an object whose
|
|
15
|
+
* `toHexString()` result passes the same check.
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { isObjectId } from 'valgen';
|
|
19
|
+
*
|
|
20
|
+
* const idString = '64897efbdf01a60ac1b678ea';
|
|
21
|
+
* isObjectId(idString); // => '64897efbdf01a60ac1b678ea'
|
|
22
|
+
* isObjectId(undefined); // throws ValidationError: "Value must be a valid ObjectId"
|
|
23
|
+
* ```
|
|
6
24
|
*/
|
|
7
25
|
export function isObjectId(options) {
|
|
8
26
|
return validator(isObjectId.name, (input, context, _this) => {
|
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a string is a valid passport number for the given country,
|
|
4
|
+
* by delegating to `validatorJS.isPassportNumber(input, countryCode)`.
|
|
5
|
+
*
|
|
6
|
+
* @param countryCode - The ISO country code to validate the passport number against.
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated passport number string, unchanged.
|
|
9
|
+
* @throws `Value must be a valid <countryCode> Passport Number` when the input
|
|
10
|
+
* isn't a valid passport number for `countryCode`.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { vg } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* const isUSPassport = vg.isPassportNumber('US');
|
|
17
|
+
* isUSPassport('123456789'); // => '123456789'
|
|
18
|
+
* isUSPassport('12345'); // throws ValidationError: "Value must be a valid US Passport Number"
|
|
19
|
+
* ```
|
|
4
20
|
* @validator isPassportNumber
|
|
5
21
|
*/
|
|
6
22
|
export declare function isPassportNumber(countryCode: string, options?: isPassportNumber.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
@@ -1,7 +1,23 @@
|
|
|
1
1
|
import validatorJS from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is a valid passport number for the given country,
|
|
5
|
+
* by delegating to `validatorJS.isPassportNumber(input, countryCode)`.
|
|
6
|
+
*
|
|
7
|
+
* @param countryCode - The ISO country code to validate the passport number against.
|
|
8
|
+
* @param options - Validation options.
|
|
9
|
+
* @returns The validated passport number string, unchanged.
|
|
10
|
+
* @throws `Value must be a valid <countryCode> Passport Number` when the input
|
|
11
|
+
* isn't a valid passport number for `countryCode`.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { vg } from 'valgen';
|
|
16
|
+
*
|
|
17
|
+
* const isUSPassport = vg.isPassportNumber('US');
|
|
18
|
+
* isUSPassport('123456789'); // => '123456789'
|
|
19
|
+
* isUSPassport('12345'); // throws ValidationError: "Value must be a valid US Passport Number"
|
|
20
|
+
* ```
|
|
5
21
|
* @validator isPassportNumber
|
|
6
22
|
*/
|
|
7
23
|
export function isPassportNumber(countryCode, options) {
|
|
@@ -1,6 +1,21 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a value is a valid TCP/UDP port number, and coerces it to a
|
|
4
|
+
* `number`. Accepts a `string` or `number` input; numbers are stringified
|
|
5
|
+
* before being checked with `validatorJS.isPort(input)`.
|
|
6
|
+
*
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The port parsed as an integer `number` - not the original string.
|
|
9
|
+
* @throws `Value must be a valid port number` when the input isn't a valid port.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { isPort } from 'valgen';
|
|
14
|
+
*
|
|
15
|
+
* isPort('80'); // => 80
|
|
16
|
+
* isPort(80); // => 80
|
|
17
|
+
* isPort('70000'); // throws ValidationError: "Value must be a valid port number"
|
|
18
|
+
* ```
|
|
4
19
|
* @validator isPort
|
|
5
20
|
*/
|
|
6
21
|
export declare function isPort(options?: isPort.Options): import("../../core/validator.js").Validator<number, string | number, import("../../core/types.js").ExecutionOptions>;
|
|
@@ -2,7 +2,22 @@ import validatorJS from '@browsery/validator';
|
|
|
2
2
|
import {} from 'ts-gems';
|
|
3
3
|
import { validator, } from '../../core/index.js';
|
|
4
4
|
/**
|
|
5
|
-
* Validates
|
|
5
|
+
* Validates that a value is a valid TCP/UDP port number, and coerces it to a
|
|
6
|
+
* `number`. Accepts a `string` or `number` input; numbers are stringified
|
|
7
|
+
* before being checked with `validatorJS.isPort(input)`.
|
|
8
|
+
*
|
|
9
|
+
* @param options - Validation options.
|
|
10
|
+
* @returns The port parsed as an integer `number` - not the original string.
|
|
11
|
+
* @throws `Value must be a valid port number` when the input isn't a valid port.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* import { isPort } from 'valgen';
|
|
16
|
+
*
|
|
17
|
+
* isPort('80'); // => 80
|
|
18
|
+
* isPort(80); // => 80
|
|
19
|
+
* isPort('70000'); // throws ValidationError: "Value must be a valid port number"
|
|
20
|
+
* ```
|
|
6
21
|
* @validator isPort
|
|
7
22
|
*/
|
|
8
23
|
export function isPort(options) {
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates that a string is a valid BIC (Bank Identification Code) or SWIFT
|
|
4
|
+
* code, by delegating to `validatorJS.isBIC(input)`.
|
|
5
|
+
*
|
|
6
|
+
* @param options - Validation options.
|
|
7
|
+
* @returns The validated BIC/SWIFT code string, unchanged.
|
|
8
|
+
* @throws `Value must be a valid BIC (Bank Identification Code) or SWIFT code`
|
|
9
|
+
* when the input isn't a valid BIC/SWIFT code.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```ts
|
|
13
|
+
* import { isSWIFT } from 'valgen';
|
|
14
|
+
*
|
|
15
|
+
* isSWIFT('DEUTDEFF500'); // => 'DEUTDEFF500'
|
|
16
|
+
* isSWIFT('1234DEFF'); // throws ValidationError: "Value must be a valid BIC (Bank Identification Code) or SWIFT code"
|
|
17
|
+
* ```
|
|
4
18
|
* @validator isSWIFT
|
|
5
19
|
*/
|
|
6
20
|
export declare function isSWIFT(options?: isSWIFT.Options): import("../../core/validator.js").Validator<string, string, import("../../core/types.js").ExecutionOptions>;
|
|
@@ -1,7 +1,21 @@
|
|
|
1
1
|
import validatorJS from '@browsery/validator';
|
|
2
2
|
import { validator, } from '../../core/index.js';
|
|
3
3
|
/**
|
|
4
|
-
* Validates
|
|
4
|
+
* Validates that a string is a valid BIC (Bank Identification Code) or SWIFT
|
|
5
|
+
* code, by delegating to `validatorJS.isBIC(input)`.
|
|
6
|
+
*
|
|
7
|
+
* @param options - Validation options.
|
|
8
|
+
* @returns The validated BIC/SWIFT code string, unchanged.
|
|
9
|
+
* @throws `Value must be a valid BIC (Bank Identification Code) or SWIFT code`
|
|
10
|
+
* when the input isn't a valid BIC/SWIFT code.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { isSWIFT } from 'valgen';
|
|
15
|
+
*
|
|
16
|
+
* isSWIFT('DEUTDEFF500'); // => 'DEUTDEFF500'
|
|
17
|
+
* isSWIFT('1234DEFF'); // throws ValidationError: "Value must be a valid BIC (Bank Identification Code) or SWIFT code"
|
|
18
|
+
* ```
|
|
5
19
|
* @validator isSWIFT
|
|
6
20
|
*/
|
|
7
21
|
export function isSWIFT(options) {
|
|
@@ -1,6 +1,27 @@
|
|
|
1
1
|
import { type ValidationOptions } from '../../core/index.js';
|
|
2
2
|
/**
|
|
3
|
-
* Validates
|
|
3
|
+
* Validates (and optionally coerces) a time-of-day value in `HH:mm`,
|
|
4
|
+
* `HH:mm:ss`, or `HH:mm:ss.SSS` format, with or without separators. Not a
|
|
5
|
+
* wrapper around `@browsery/validator` - it uses its own regex and checks
|
|
6
|
+
* hour ≤ 23, minutes/seconds ≤ 59.
|
|
7
|
+
*
|
|
8
|
+
* @param options - Validation options. When `coerce` is `true`, a `Date`
|
|
9
|
+
* input is converted to a `HH:mm:ss[.SSS]` string, and a compact form
|
|
10
|
+
* without separators (e.g. `'1230'`) is normalized to colon-separated form;
|
|
11
|
+
* without `coerce`, the input string is returned unchanged.
|
|
12
|
+
* @returns The validated (and possibly coerced) time string.
|
|
13
|
+
* @throws `Value must be a valid Time` when the input isn't a recognized
|
|
14
|
+
* time-of-day value.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { isTime } from 'valgen';
|
|
19
|
+
*
|
|
20
|
+
* isTime('12:30', { coerce: true }); // => '12:30'
|
|
21
|
+
* isTime('1230', { coerce: true }); // => '12:30'
|
|
22
|
+
* isTime(new Date('2025-01-10T08:30:15'), { coerce: true }); // => '08:30:15'
|
|
23
|
+
* isTime('25:00'); // throws ValidationError: "Value must be a valid Time"
|
|
24
|
+
* ```
|
|
4
25
|
* @validator isTime
|
|
5
26
|
*/
|
|
6
27
|
export declare function isTime(options?: isTime.Options): import("../../core/validator.js").Validator<string, string | Date, import("../../core/types.js").ExecutionOptions>;
|