@clementine-solutions/jane-io 1.0.0 → 1.0.1
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 +132 -1
- package/dist/core/analysis/diff.d.ts +35 -0
- package/dist/core/analysis/explain.d.ts +35 -0
- package/dist/core/analysis/index.d.ts +14 -0
- package/dist/core/analysis/replay.d.ts +34 -0
- package/dist/core/analysis/telemetry.d.ts +28 -0
- package/dist/core/boundary-rules/at-most-one.d.ts +17 -0
- package/dist/core/boundary-rules/conditionally-required.d.ts +18 -0
- package/dist/core/boundary-rules/date-range.d.ts +17 -0
- package/dist/core/boundary-rules/index.d.ts +18 -0
- package/dist/core/boundary-rules/mutually-exclusive.d.ts +16 -0
- package/dist/core/boundary-rules/no-unknown-fields.d.ts +17 -0
- package/dist/core/boundary-rules/require-all.d.ts +16 -0
- package/dist/core/boundary-rules/require-one.d.ts +17 -0
- package/dist/core/common/events.d.ts +37 -0
- package/dist/core/common/fluent.d.ts +151 -0
- package/dist/core/common/index.d.ts +16 -0
- package/dist/core/common/policy.d.ts +170 -0
- package/dist/core/common/utilities.d.ts +59 -0
- package/dist/core/common/wildcard.d.ts +27 -0
- package/dist/core/field-path/construct.d.ts +77 -0
- package/dist/core/field-path/format.d.ts +41 -0
- package/dist/core/field-path/index.d.ts +14 -0
- package/dist/core/field-path/utilities.d.ts +85 -0
- package/dist/core/field-path/walk.d.ts +36 -0
- package/dist/core/fluent-registry.d.ts +138 -0
- package/dist/core/normalizers/array/compact-sparse-array.d.ts +22 -0
- package/dist/core/normalizers/array/flatten-one-level.d.ts +17 -0
- package/dist/core/normalizers/array/remove-empty-string-items.d.ts +6 -0
- package/dist/core/normalizers/array/remove-null-items.d.ts +16 -0
- package/dist/core/normalizers/array/remove-undefined-items.d.ts +16 -0
- package/dist/core/normalizers/date/invalid-date-to-undefined.d.ts +17 -0
- package/dist/core/normalizers/index.d.ts +28 -0
- package/dist/core/normalizers/normalizer-register.d.ts +17 -0
- package/dist/core/normalizers/number/infinity-to-undefined.d.ts +18 -0
- package/dist/core/normalizers/number/nan-to-undefined.d.ts +17 -0
- package/dist/core/normalizers/number/normalize-negative-zero.d.ts +16 -0
- package/dist/core/normalizers/object/remove-empty-array-keys.d.ts +17 -0
- package/dist/core/normalizers/object/remove-empty-object-keys.d.ts +16 -0
- package/dist/core/normalizers/object/remove-empty-string-keys.d.ts +16 -0
- package/dist/core/normalizers/object/remove-null-keys.d.ts +16 -0
- package/dist/core/normalizers/object/remove-undefined-keys.d.ts +16 -0
- package/dist/core/normalizers/string/collapse-whitespace.d.ts +17 -0
- package/dist/core/normalizers/string/empty-to-undefined.d.ts +16 -0
- package/dist/core/normalizers/string/trim.d.ts +16 -0
- package/dist/core/parsers/index.d.ts +22 -0
- package/dist/core/parsers/parse-array-string.d.ts +16 -0
- package/dist/core/parsers/parse-bigint-string.d.ts +16 -0
- package/dist/core/parsers/parse-binary-string.d.ts +16 -0
- package/dist/core/parsers/parse-boolean-string.d.ts +16 -0
- package/dist/core/parsers/parse-date-string.d.ts +16 -0
- package/dist/core/parsers/parse-duration-string.d.ts +16 -0
- package/dist/core/parsers/parse-hex-string.d.ts +16 -0
- package/dist/core/parsers/parse-integer-string.d.ts +16 -0
- package/dist/core/parsers/parse-json-string.d.ts +17 -0
- package/dist/core/parsers/parse-numeric-string.d.ts +16 -0
- package/dist/core/parsers/parse-object-string.d.ts +16 -0
- package/dist/core/parsers/parse-octal-string.d.ts +16 -0
- package/dist/core/parsers/parse-scientific-notation-string.d.ts +16 -0
- package/dist/core/parsers/parse-url-string.d.ts +16 -0
- package/dist/core/pipeline/boundary.d.ts +36 -0
- package/dist/core/pipeline/contain.d.ts +122 -0
- package/dist/core/pipeline/index.d.ts +16 -0
- package/dist/core/pipeline/normalize.d.ts +34 -0
- package/dist/core/pipeline/parse.d.ts +40 -0
- package/dist/core/pipeline/pipeline.d.ts +23 -0
- package/dist/core/pipeline/scan.d.ts +46 -0
- package/dist/core/pipeline/validate.d.ts +40 -0
- package/dist/core/scanners/any/scan-for-sentinels.d.ts +19 -0
- package/dist/core/scanners/array/array-is-deep.d.ts +19 -0
- package/dist/core/scanners/array/array-is-heterogenous.d.ts +18 -0
- package/dist/core/scanners/array/array-is-large.d.ts +19 -0
- package/dist/core/scanners/bigint/bigint-is-large.d.ts +20 -0
- package/dist/core/scanners/bigint/bigint-not-safe.d.ts +20 -0
- package/dist/core/scanners/date/date-is-before-epoch.d.ts +19 -0
- package/dist/core/scanners/date/date-is-far-future.d.ts +19 -0
- package/dist/core/scanners/date/date-is-invalid.d.ts +19 -0
- package/dist/core/scanners/index.d.ts +31 -0
- package/dist/core/scanners/number/number-is-infinite.d.ts +19 -0
- package/dist/core/scanners/number/number-is-nan.d.ts +19 -0
- package/dist/core/scanners/number/number-is-too-large.d.ts +20 -0
- package/dist/core/scanners/number/number-is-unsafe-integer.d.ts +19 -0
- package/dist/core/scanners/object/object-has-circular-references.d.ts +20 -0
- package/dist/core/scanners/object/object-has-many-keys.d.ts +19 -0
- package/dist/core/scanners/object/object-is-deep.d.ts +20 -0
- package/dist/core/scanners/scanner-registry.d.ts +19 -0
- package/dist/core/scanners/string/string-has-unsafe-unicode.d.ts +19 -0
- package/dist/core/scanners/string/string-has-whitespace-edges.d.ts +19 -0
- package/dist/core/scanners/string/string-is-long.d.ts +19 -0
- package/dist/core/scanners/unknown/unknown-not-scannable.d.ts +21 -0
- package/dist/core/shapes/analysis.d.ts +239 -0
- package/dist/core/shapes/boundary.d.ts +126 -0
- package/dist/core/shapes/events.d.ts +83 -0
- package/dist/core/shapes/field-path.d.ts +51 -0
- package/dist/core/shapes/index.d.ts +21 -0
- package/dist/core/shapes/normalize.d.ts +59 -0
- package/dist/core/shapes/parse.d.ts +75 -0
- package/dist/core/shapes/pipeline.d.ts +149 -0
- package/dist/core/shapes/policy.d.ts +158 -0
- package/dist/core/shapes/public.d.ts +92 -0
- package/dist/core/shapes/scan.d.ts +126 -0
- package/dist/core/shapes/validate.d.ts +65 -0
- package/dist/core/validators/array/array-max-items.d.ts +25 -0
- package/dist/core/validators/array/array-min-items.d.ts +25 -0
- package/dist/core/validators/array/array.d.ts +22 -0
- package/dist/core/validators/array/excludes.d.ts +25 -0
- package/dist/core/validators/array/has-unique-items.d.ts +24 -0
- package/dist/core/validators/array/includes.d.ts +24 -0
- package/dist/core/validators/array/items-equal.d.ts +25 -0
- package/dist/core/validators/array/no-empty-string-items.d.ts +24 -0
- package/dist/core/validators/array/no-null-items.d.ts +24 -0
- package/dist/core/validators/array/no-undefined-items.d.ts +24 -0
- package/dist/core/validators/array/non-empty-array.d.ts +24 -0
- package/dist/core/validators/array/not-sparse.d.ts +25 -0
- package/dist/core/validators/bigint/bigint-equals.d.ts +24 -0
- package/dist/core/validators/bigint/bigint-max.d.ts +25 -0
- package/dist/core/validators/bigint/bigint-min.d.ts +25 -0
- package/dist/core/validators/bigint/bigint-negative.d.ts +23 -0
- package/dist/core/validators/bigint/bigint-non-negative.d.ts +24 -0
- package/dist/core/validators/bigint/bigint-non-positive.d.ts +24 -0
- package/dist/core/validators/bigint/bigint-positive.d.ts +24 -0
- package/dist/core/validators/bigint/bigint-safe.d.ts +25 -0
- package/dist/core/validators/bigint/bigint.d.ts +20 -0
- package/dist/core/validators/boolean/boolean.d.ts +21 -0
- package/dist/core/validators/boolean/is-false.d.ts +22 -0
- package/dist/core/validators/boolean/is-true.d.ts +22 -0
- package/dist/core/validators/common/is-country-code.d.ts +17 -0
- package/dist/core/validators/common/is-currency-code.d.ts +17 -0
- package/dist/core/validators/common/is-email-strict.d.ts +17 -0
- package/dist/core/validators/common/is-email.d.ts +17 -0
- package/dist/core/validators/common/is-ip.d.ts +17 -0
- package/dist/core/validators/common/is-phone-strict.d.ts +17 -0
- package/dist/core/validators/common/is-phone.d.ts +17 -0
- package/dist/core/validators/common/is-port.d.ts +17 -0
- package/dist/core/validators/common/is-postal-code.d.ts +17 -0
- package/dist/core/validators/common/is-url.d.ts +17 -0
- package/dist/core/validators/common/is-uuid.d.ts +17 -0
- package/dist/core/validators/date/before-epoch.d.ts +28 -0
- package/dist/core/validators/date/date-now-required.d.ts +22 -0
- package/dist/core/validators/date/is-date.d.ts +21 -0
- package/dist/core/validators/date/is-far-future.d.ts +23 -0
- package/dist/core/validators/date/is-future.d.ts +24 -0
- package/dist/core/validators/date/is-past.d.ts +24 -0
- package/dist/core/validators/date/not-after.d.ts +25 -0
- package/dist/core/validators/date/not-before.d.ts +25 -0
- package/dist/core/validators/date/same-day.d.ts +25 -0
- package/dist/core/validators/date/same-month.d.ts +25 -0
- package/dist/core/validators/date/same-year.d.ts +24 -0
- package/dist/core/validators/date/too-early.d.ts +25 -0
- package/dist/core/validators/date/too-late.d.ts +25 -0
- package/dist/core/validators/date/weekday.d.ts +32 -0
- package/dist/core/validators/date/weekend.d.ts +27 -0
- package/dist/core/validators/index.d.ts +112 -0
- package/dist/core/validators/nullish/is-null-or-undefined.d.ts +22 -0
- package/dist/core/validators/nullish/is-null.d.ts +21 -0
- package/dist/core/validators/nullish/is-undefined.d.ts +21 -0
- package/dist/core/validators/number/finite.d.ts +22 -0
- package/dist/core/validators/number/integer.d.ts +22 -0
- package/dist/core/validators/number/less-than.d.ts +21 -0
- package/dist/core/validators/number/max.d.ts +21 -0
- package/dist/core/validators/number/min.d.ts +21 -0
- package/dist/core/validators/number/more-than.d.ts +21 -0
- package/dist/core/validators/number/negative.d.ts +20 -0
- package/dist/core/validators/number/non-negative.d.ts +19 -0
- package/dist/core/validators/number/non-positive.d.ts +19 -0
- package/dist/core/validators/number/number.d.ts +19 -0
- package/dist/core/validators/number/positive.d.ts +20 -0
- package/dist/core/validators/number/safe-integer.d.ts +19 -0
- package/dist/core/validators/object/deep-equals.d.ts +24 -0
- package/dist/core/validators/object/has-key.d.ts +23 -0
- package/dist/core/validators/object/has-value.d.ts +27 -0
- package/dist/core/validators/object/keys-equal.d.ts +26 -0
- package/dist/core/validators/object/max-keys.d.ts +24 -0
- package/dist/core/validators/object/min-keys.d.ts +24 -0
- package/dist/core/validators/object/missing-key.d.ts +23 -0
- package/dist/core/validators/object/no-empty-array-values.d.ts +23 -0
- package/dist/core/validators/object/no-empty-object-values.d.ts +23 -0
- package/dist/core/validators/object/no-null-values.d.ts +23 -0
- package/dist/core/validators/object/no-undefined-values.d.ts +23 -0
- package/dist/core/validators/object/non-empty-object.d.ts +21 -0
- package/dist/core/validators/object/only-keys.d.ts +23 -0
- package/dist/core/validators/object/plain-object.d.ts +22 -0
- package/dist/core/validators/string/alpha-num.d.ts +23 -0
- package/dist/core/validators/string/alpha.d.ts +24 -0
- package/dist/core/validators/string/chars-equal.d.ts +23 -0
- package/dist/core/validators/string/ends-with.d.ts +23 -0
- package/dist/core/validators/string/is-ascii.d.ts +24 -0
- package/dist/core/validators/string/is-printable.d.ts +25 -0
- package/dist/core/validators/string/matches.d.ts +23 -0
- package/dist/core/validators/string/max-length.d.ts +24 -0
- package/dist/core/validators/string/min-length.d.ts +24 -0
- package/dist/core/validators/string/no-lead-space.d.ts +23 -0
- package/dist/core/validators/string/no-repeat-space.d.ts +25 -0
- package/dist/core/validators/string/no-space.d.ts +24 -0
- package/dist/core/validators/string/no-trail-space.d.ts +23 -0
- package/dist/core/validators/string/non-empty.d.ts +22 -0
- package/dist/core/validators/string/not-one-of.d.ts +24 -0
- package/dist/core/validators/string/num-string.d.ts +23 -0
- package/dist/core/validators/string/one-of.d.ts +23 -0
- package/dist/core/validators/string/starts-with.d.ts +23 -0
- package/dist/core/validators/string/string.d.ts +21 -0
- package/dist/core/validators/string/trimmed.d.ts +24 -0
- package/dist/index.d.ts +83 -0
- package/dist/test.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Bigint Positive
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a string representing a BigInt that is
|
|
7
|
+
* strictly greater than zero.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a string representing a BigInt that is strictly greater
|
|
14
|
+
* than zero.
|
|
15
|
+
*
|
|
16
|
+
* - Non-string values emit `bigint.not.string`.
|
|
17
|
+
* - Empty strings and non-parseable strings emit `bigint.not.bigint`.
|
|
18
|
+
* - Parsed BigInt values ≤ 0 emit `bigint.not.positive`.
|
|
19
|
+
*
|
|
20
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
21
|
+
* provided path. It supports userMessage overrides applied at the
|
|
22
|
+
* pipeline level.
|
|
23
|
+
*/
|
|
24
|
+
export declare const bigintPositive: ValidationRule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Bigint Safe
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a string representing a BigInt that
|
|
7
|
+
* falls within JavaScript’s safe integer range.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a string representing a BigInt that falls
|
|
14
|
+
* within JavaScript’s safe integer range (Number.MIN_SAFE_INTEGER
|
|
15
|
+
* through Number.MAX_SAFE_INTEGER).
|
|
16
|
+
*
|
|
17
|
+
* - Non-string values emit `bigint.not.string`.
|
|
18
|
+
* - Empty strings and non-parseable strings emit `bigint.not.bigint`.
|
|
19
|
+
* - Parsed BigInt values outside the safe range emit `bigint.not.safe`.
|
|
20
|
+
*
|
|
21
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
22
|
+
* provided path. It supports userMessage overrides applied at the
|
|
23
|
+
* pipeline level.
|
|
24
|
+
*/
|
|
25
|
+
export declare const bigintSafe: ValidationRule;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Bigint
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a native JavaScript BigInt value.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Ensures the input is a native JavaScript BigInt value.
|
|
13
|
+
*
|
|
14
|
+
* - Non-bigint values emit `bigint.not.bigint`.
|
|
15
|
+
*
|
|
16
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
17
|
+
* provided path. It supports userMessage overrides applied at the
|
|
18
|
+
* pipeline level.
|
|
19
|
+
*/
|
|
20
|
+
export declare const bigint: ValidationRule;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Boolean
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates that the value is a boolean.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates that the value is a boolean.
|
|
13
|
+
*
|
|
14
|
+
* - Non‑boolean values emit `boolean.not.boolean`.
|
|
15
|
+
* - Returns an empty array when the value is a valid boolean.
|
|
16
|
+
*
|
|
17
|
+
* This rule is pure, total, async‑compatible, and returns a readonly array of
|
|
18
|
+
* JaneEvent objects. It preserves the provided path and supports userMessage
|
|
19
|
+
* overrides applied at the pipeline level.
|
|
20
|
+
*/
|
|
21
|
+
export declare const boolean: ValidationRule;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is False
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates that the value is the boolean literal `false`.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates that the value is the boolean literal `false`.
|
|
13
|
+
*
|
|
14
|
+
* - Non‑boolean values emit `boolean.not.boolean`.
|
|
15
|
+
* - The boolean literal `true` emits `boolean.not.false`.
|
|
16
|
+
* - Returns an empty array when the value is exactly `false`.
|
|
17
|
+
*
|
|
18
|
+
* This rule is pure, total, async‑compatible, and returns a readonly array of
|
|
19
|
+
* JaneEvent objects. It preserves the provided path and supports userMessage
|
|
20
|
+
* overrides applied at the pipeline level.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isFalse: ValidationRule;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is True
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates that the value is the boolean literal `true`.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates that the value is the boolean literal `true`.
|
|
13
|
+
*
|
|
14
|
+
* - Non‑boolean values emit `boolean.not.boolean`.
|
|
15
|
+
* - The boolean literal `false` emits `boolean.not.true`.
|
|
16
|
+
* - Returns an empty array when the value is exactly `true`.
|
|
17
|
+
*
|
|
18
|
+
* This rule is pure, total, async‑compatible, and returns a readonly array of
|
|
19
|
+
* JaneEvent objects. It preserves the provided path and supports userMessage
|
|
20
|
+
* overrides applied at the pipeline level.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isTrue: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Country Code
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates ISO‑3166‑1 alpha‑2 country codes.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates ISO‑3166‑1 alpha‑2 country codes.
|
|
13
|
+
*
|
|
14
|
+
* Country codes must be exactly two uppercase letters. This helps ensure
|
|
15
|
+
* consistent, standards‑aligned identifiers for geographic data.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isCountryCode: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Country Code
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates ISO‑4217 currency codes.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates ISO‑4217 currency codes.
|
|
13
|
+
*
|
|
14
|
+
* Currency codes must be three uppercase letters. This prevents malformed or
|
|
15
|
+
* non‑standard currency identifiers from entering downstream systems.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isCurrencyCode: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Email Strict
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates strict RFC‑style email addresses.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates strict RFC‑style email addresses.
|
|
13
|
+
*
|
|
14
|
+
* Enforces a detailed pattern for both the local part and domain, catching
|
|
15
|
+
* malformed or ambiguous email strings before they propagate further.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isEmailStrict: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Email
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates general‑purpose email addresses.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates general‑purpose email addresses.
|
|
13
|
+
*
|
|
14
|
+
* Uses a permissive but reliable pattern suitable for everyday user input,
|
|
15
|
+
* ensuring the value resembles a conventional email address.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isEmail: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is IP (v4 and v6)
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates IPv4 and IPv6 addresses.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates IPv4 and IPv6 addresses.
|
|
13
|
+
*
|
|
14
|
+
* Ensures the string matches canonical patterns for either protocol, helping
|
|
15
|
+
* prevent malformed network identifiers from entering the system.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isIp: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Phone Strict
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates strict E.164 international phone numbers.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates strict E.164 international phone numbers.
|
|
13
|
+
*
|
|
14
|
+
* Requires a leading plus sign and 8–15 digits, ensuring globally portable,
|
|
15
|
+
* unambiguous phone identifiers.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isPhoneStrict: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Phone
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates loosely formatted phone numbers.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates loosely formatted phone numbers.
|
|
13
|
+
*
|
|
14
|
+
* Extracts digits and enforces a minimum length, providing a flexible check
|
|
15
|
+
* suitable for user‑entered phone fields.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isPhone: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Port
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates TCP/UDP port numbers.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates TCP/UDP port numbers.
|
|
13
|
+
*
|
|
14
|
+
* Ports must be integers between 0 and 65535. This prevents invalid or
|
|
15
|
+
* out‑of‑range port values from being accepted.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isPort: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Postal Code
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates alphanumeric postal codes.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates alphanumeric postal codes.
|
|
13
|
+
*
|
|
14
|
+
* Accepts letters, digits, spaces, and hyphens within a reasonable length
|
|
15
|
+
* range, supporting a wide variety of international postal formats.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isPostalCode: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is URL
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates URLs using the WHATWG URL parser.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates URLs using the WHATWG URL parser.
|
|
13
|
+
*
|
|
14
|
+
* Ensures the string is a syntactically valid absolute URL, preventing malformed
|
|
15
|
+
* or incomplete URL values from being accepted.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isUrl: ValidationRule;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is UUID
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates UUIDs (versions 1–4).
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Validates UUIDs (versions 1–4).
|
|
13
|
+
*
|
|
14
|
+
* Enforces canonical hyphenated formatting and correct version/variant bits,
|
|
15
|
+
* ensuring the identifier is structurally sound and standards‑compliant.
|
|
16
|
+
*/
|
|
17
|
+
export declare const isUuid: ValidationRule;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Before Epoch
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Validates that a value is a JavaScript Date occurring before
|
|
7
|
+
* the Unix epoch (January 1, 1970, 00:00:00 UTC).
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Validates that a value is a JavaScript Date occurring before
|
|
14
|
+
* the Unix epoch (January 1, 1970, 00:00:00 UTC).
|
|
15
|
+
*
|
|
16
|
+
* This rule checks:
|
|
17
|
+
* - The value is structurally a Date instance
|
|
18
|
+
* - The date timestamp is strictly less than the Unix epoch
|
|
19
|
+
*
|
|
20
|
+
* Emits:
|
|
21
|
+
* - date.not.date (value is not a Date)
|
|
22
|
+
* - date.not.beforeEpoch (date is on or after the Unix epoch)
|
|
23
|
+
*
|
|
24
|
+
* This rule is async-compatible and returns a readonly array
|
|
25
|
+
* of JaneEvent objects.
|
|
26
|
+
* ----------------------------------------------------------------------------
|
|
27
|
+
*/
|
|
28
|
+
export declare const beforeEpoch: ValidationRule;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Date Now Required
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing today's
|
|
7
|
+
* date.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance representing today's date.
|
|
14
|
+
*
|
|
15
|
+
* - Non-Date values emit `date.not.date`.
|
|
16
|
+
* - Dates not matching today's year/month/day emit `date.now.undefined`.
|
|
17
|
+
*
|
|
18
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
19
|
+
* provided path. It supports userMessage overrides applied at the
|
|
20
|
+
* pipeline level.
|
|
21
|
+
*/
|
|
22
|
+
export declare const dateNowRequired: ValidationRule;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Date
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a valid JavaScript Date instance.
|
|
7
|
+
* @see https://jane-io.com
|
|
8
|
+
* ----------------------------------------------------------------------------
|
|
9
|
+
*/
|
|
10
|
+
import type { ValidationRule } from '../../shapes';
|
|
11
|
+
/**
|
|
12
|
+
* Ensures the input is a valid JavaScript Date instance.
|
|
13
|
+
*
|
|
14
|
+
* - Non-Date values emit `date.not.date`.
|
|
15
|
+
* - Invalid Date instances (NaN timestamp) emit `date.is.invalid`.
|
|
16
|
+
*
|
|
17
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
18
|
+
* provided path. It supports userMessage overrides applied at the
|
|
19
|
+
* pipeline level.
|
|
20
|
+
*/
|
|
21
|
+
export declare const isDate: ValidationRule;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Far Future
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing a year
|
|
7
|
+
* strictly greater than 2100.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance representing a year strictly
|
|
14
|
+
* greater than 2100.
|
|
15
|
+
*
|
|
16
|
+
* - Non-Date values emit `date.not.date`.
|
|
17
|
+
* - Dates with year ≤ 2100 emit `date.is.far-future`.
|
|
18
|
+
*
|
|
19
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
20
|
+
* provided path. It supports userMessage overrides applied at the
|
|
21
|
+
* pipeline level.
|
|
22
|
+
*/
|
|
23
|
+
export declare const isFarFuture: ValidationRule;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Future
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing a moment
|
|
7
|
+
* strictly after the current system time.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance representing a moment strictly
|
|
14
|
+
* after the current system time.
|
|
15
|
+
*
|
|
16
|
+
* - Non-Date values emit `date.not.date`.
|
|
17
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
18
|
+
* - Dates ≤ now emit `date.in.past`.
|
|
19
|
+
*
|
|
20
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
21
|
+
* provided path. It supports userMessage overrides applied at the
|
|
22
|
+
* pipeline level.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isFuture: ValidationRule;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Is Past
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing a moment
|
|
7
|
+
* strictly before the current system time.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance representing a moment strictly
|
|
14
|
+
* before the current system time.
|
|
15
|
+
*
|
|
16
|
+
* - Non-Date values emit `date.not.date`.
|
|
17
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
18
|
+
* - Dates ≥ now emit `date.in.future`.
|
|
19
|
+
*
|
|
20
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
21
|
+
* provided path. It supports userMessage overrides applied at the
|
|
22
|
+
* pipeline level.
|
|
23
|
+
*/
|
|
24
|
+
export declare const isPast: ValidationRule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Not After
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance that is not after the
|
|
7
|
+
* provided `max` boundary.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance that is not after the
|
|
14
|
+
* provided `max` boundary. The comparison is strict: value must be
|
|
15
|
+
* ≤ max.
|
|
16
|
+
*
|
|
17
|
+
* - Non-Date values emit `date.not.date`.
|
|
18
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
19
|
+
* - Dates > max emit `date.too.late`.
|
|
20
|
+
*
|
|
21
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
22
|
+
* provided path. It supports userMessage overrides applied at the
|
|
23
|
+
* pipeline level.
|
|
24
|
+
*/
|
|
25
|
+
export declare const notAfter: (max: Date) => ValidationRule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Not Before
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance that is not before the
|
|
7
|
+
* provided `min` boundary.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance that is not before the
|
|
14
|
+
* provided `min` boundary. The comparison is inclusive: value must be
|
|
15
|
+
* ≥ min.
|
|
16
|
+
*
|
|
17
|
+
* - Non-Date values emit `date.not.date`.
|
|
18
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
19
|
+
* - Dates < min emit `date.too.early`.
|
|
20
|
+
*
|
|
21
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
22
|
+
* provided path. It supports userMessage overrides applied at the
|
|
23
|
+
* pipeline level.
|
|
24
|
+
*/
|
|
25
|
+
export declare const notBefore: (min: Date) => ValidationRule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Same Day
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing the same
|
|
7
|
+
* calendar day (year, month, day) as the provided `other`
|
|
8
|
+
* date.
|
|
9
|
+
* @see https://jane-io.com
|
|
10
|
+
* ----------------------------------------------------------------------------
|
|
11
|
+
*/
|
|
12
|
+
import type { ValidationRule } from '../../shapes';
|
|
13
|
+
/**
|
|
14
|
+
* Ensures the input is a Date instance representing the same
|
|
15
|
+
* calendar day (year, month, day) as the provided `other` date.
|
|
16
|
+
*
|
|
17
|
+
* - Non-Date values emit `date.not.date`.
|
|
18
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
19
|
+
* - Dates not matching the same Y/M/D emit `date.not.same-day`.
|
|
20
|
+
*
|
|
21
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
22
|
+
* provided path. It supports userMessage overrides applied at the
|
|
23
|
+
* pipeline level.
|
|
24
|
+
*/
|
|
25
|
+
export declare const sameDay: (other: Date) => ValidationRule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Same Month
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing a date in
|
|
7
|
+
* the same calendar month (year + month) as the provided
|
|
8
|
+
* `other` date.
|
|
9
|
+
* @see https://jane-io.com
|
|
10
|
+
* ----------------------------------------------------------------------------
|
|
11
|
+
*/
|
|
12
|
+
import type { ValidationRule } from '../../shapes';
|
|
13
|
+
/**
|
|
14
|
+
* Ensures the input is a Date instance representing a date in the
|
|
15
|
+
* same calendar month (year + month) as the provided `other` date.
|
|
16
|
+
*
|
|
17
|
+
* - Non-Date values emit `date.not.date`.
|
|
18
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
19
|
+
* - Dates not matching the same Y/M emit `date.not.same-month`.
|
|
20
|
+
*
|
|
21
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
22
|
+
* provided path. It supports userMessage overrides applied at the
|
|
23
|
+
* pipeline level.
|
|
24
|
+
*/
|
|
25
|
+
export declare const sameMonth: (other: Date) => ValidationRule;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Same Year
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance representing a date in
|
|
7
|
+
* the same calendar year as the provided `other` date.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance representing a date in the
|
|
14
|
+
* same calendar year as the provided `other` date.
|
|
15
|
+
*
|
|
16
|
+
* - Non-Date values emit `date.not.date`.
|
|
17
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
18
|
+
* - Dates not matching the same year emit `date.not.same-year`.
|
|
19
|
+
*
|
|
20
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
21
|
+
* provided path. It supports userMessage overrides applied at the
|
|
22
|
+
* pipeline level.
|
|
23
|
+
*/
|
|
24
|
+
export declare const sameYear: (other: Date) => ValidationRule;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ----------------------------------------------------------------------------
|
|
3
|
+
* Validators | Too Early
|
|
4
|
+
* ----------------------------------------------------------------------------
|
|
5
|
+
* @package @clementine-solutions/jane
|
|
6
|
+
* @description Ensures the input is a Date instance that is not earlier
|
|
7
|
+
* than the provided `min` boundary.
|
|
8
|
+
* @see https://jane-io.com
|
|
9
|
+
* ----------------------------------------------------------------------------
|
|
10
|
+
*/
|
|
11
|
+
import type { ValidationRule } from '../../shapes';
|
|
12
|
+
/**
|
|
13
|
+
* Ensures the input is a Date instance that is not earlier than the
|
|
14
|
+
* provided `min` boundary. The comparison is inclusive: value must be
|
|
15
|
+
* ≥ min.
|
|
16
|
+
*
|
|
17
|
+
* - Non-Date values emit `date.not.date`.
|
|
18
|
+
* - Invalid Date instances emit `date.is.invalid`.
|
|
19
|
+
* - Dates < min emit `date.too.early`.
|
|
20
|
+
*
|
|
21
|
+
* This rule is pure, total, async-compatible, and preserves the
|
|
22
|
+
* provided path. It supports userMessage overrides applied at the
|
|
23
|
+
* pipeline level.
|
|
24
|
+
*/
|
|
25
|
+
export declare const tooEarly: (min: Date) => ValidationRule;
|