@warlock.js/seal 4.0.31 → 4.0.39
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/cjs/index.js +2 -1
- package/cjs/index.js.map +1 -1
- package/esm/index.js +2 -1
- package/esm/index.js.map +1 -1
- package/package.json +36 -48
- package/cjs/config.d.ts +0 -48
- package/cjs/config.d.ts.map +0 -1
- package/cjs/config.js +0 -42
- package/cjs/config.js.map +0 -1
- package/cjs/factory/index.d.ts +0 -3
- package/cjs/factory/index.d.ts.map +0 -1
- package/cjs/factory/validate.d.ts +0 -8
- package/cjs/factory/validate.d.ts.map +0 -1
- package/cjs/factory/validate.js +0 -21
- package/cjs/factory/validate.js.map +0 -1
- package/cjs/factory/validators.d.ts +0 -36
- package/cjs/factory/validators.d.ts.map +0 -1
- package/cjs/factory/validators.js +0 -39
- package/cjs/factory/validators.js.map +0 -1
- package/cjs/helpers/date-helpers.d.ts +0 -16
- package/cjs/helpers/date-helpers.d.ts.map +0 -1
- package/cjs/helpers/date-helpers.js +0 -20
- package/cjs/helpers/date-helpers.js.map +0 -1
- package/cjs/helpers/get-field-value.d.ts +0 -37
- package/cjs/helpers/get-field-value.d.ts.map +0 -1
- package/cjs/helpers/get-field-value.js +0 -40
- package/cjs/helpers/get-field-value.js.map +0 -1
- package/cjs/helpers/index.d.ts +0 -5
- package/cjs/helpers/index.d.ts.map +0 -1
- package/cjs/helpers/path-helpers.d.ts +0 -5
- package/cjs/helpers/path-helpers.d.ts.map +0 -1
- package/cjs/helpers/path-helpers.js +0 -8
- package/cjs/helpers/path-helpers.js.map +0 -1
- package/cjs/helpers/validation-helpers.d.ts +0 -4
- package/cjs/helpers/validation-helpers.d.ts.map +0 -1
- package/cjs/helpers/validation-helpers.js +0 -48
- package/cjs/helpers/validation-helpers.js.map +0 -1
- package/cjs/index.d.ts +0 -29
- package/cjs/index.d.ts.map +0 -1
- package/cjs/mutators/array-mutators.d.ts +0 -12
- package/cjs/mutators/array-mutators.d.ts.map +0 -1
- package/cjs/mutators/array-mutators.js +0 -37
- package/cjs/mutators/array-mutators.js.map +0 -1
- package/cjs/mutators/date-mutators.d.ts +0 -39
- package/cjs/mutators/date-mutators.d.ts.map +0 -1
- package/cjs/mutators/date-mutators.js +0 -120
- package/cjs/mutators/date-mutators.js.map +0 -1
- package/cjs/mutators/index.d.ts +0 -7
- package/cjs/mutators/index.d.ts.map +0 -1
- package/cjs/mutators/number-mutators.d.ts +0 -9
- package/cjs/mutators/number-mutators.d.ts.map +0 -1
- package/cjs/mutators/number-mutators.js +0 -23
- package/cjs/mutators/number-mutators.js.map +0 -1
- package/cjs/mutators/object-mutators.d.ts +0 -8
- package/cjs/mutators/object-mutators.d.ts.map +0 -1
- package/cjs/mutators/object-mutators.js +0 -50
- package/cjs/mutators/object-mutators.js.map +0 -1
- package/cjs/mutators/scalar-mutators.d.ts +0 -3
- package/cjs/mutators/scalar-mutators.d.ts.map +0 -1
- package/cjs/mutators/scalar-mutators.js +0 -6
- package/cjs/mutators/scalar-mutators.js.map +0 -1
- package/cjs/mutators/string-mutators.d.ts +0 -72
- package/cjs/mutators/string-mutators.d.ts.map +0 -1
- package/cjs/mutators/string-mutators.js +0 -193
- package/cjs/mutators/string-mutators.js.map +0 -1
- package/cjs/plugins/index.d.ts +0 -7
- package/cjs/plugins/index.d.ts.map +0 -1
- package/cjs/plugins/plugin-system.d.ts +0 -71
- package/cjs/plugins/plugin-system.d.ts.map +0 -1
- package/cjs/plugins/plugin-system.js +0 -68
- package/cjs/plugins/plugin-system.js.map +0 -1
- package/cjs/rules/array/array-rules.d.ts +0 -12
- package/cjs/rules/array/array-rules.d.ts.map +0 -1
- package/cjs/rules/array/array-rules.js +0 -44
- package/cjs/rules/array/array-rules.js.map +0 -1
- package/cjs/rules/array/index.d.ts +0 -2
- package/cjs/rules/array/index.d.ts.map +0 -1
- package/cjs/rules/color/color-rules.d.ts +0 -30
- package/cjs/rules/color/color-rules.d.ts.map +0 -1
- package/cjs/rules/color/color-rules.js +0 -120
- package/cjs/rules/color/color-rules.js.map +0 -1
- package/cjs/rules/color/index.d.ts +0 -2
- package/cjs/rules/color/index.d.ts.map +0 -1
- package/cjs/rules/common/enum.d.ts +0 -26
- package/cjs/rules/common/enum.d.ts.map +0 -1
- package/cjs/rules/common/enum.js +0 -55
- package/cjs/rules/common/enum.js.map +0 -1
- package/cjs/rules/common/equals-field-rules.d.ts +0 -18
- package/cjs/rules/common/equals-field-rules.d.ts.map +0 -1
- package/cjs/rules/common/equals-field-rules.js +0 -38
- package/cjs/rules/common/equals-field-rules.js.map +0 -1
- package/cjs/rules/common/index.d.ts +0 -5
- package/cjs/rules/common/index.d.ts.map +0 -1
- package/cjs/rules/common/type-rules.d.ts +0 -34
- package/cjs/rules/common/type-rules.d.ts.map +0 -1
- package/cjs/rules/common/type-rules.js +0 -104
- package/cjs/rules/common/type-rules.js.map +0 -1
- package/cjs/rules/common/unknown-key.d.ts +0 -9
- package/cjs/rules/common/unknown-key.d.ts.map +0 -1
- package/cjs/rules/common/unknown-key.js +0 -20
- package/cjs/rules/common/unknown-key.js.map +0 -1
- package/cjs/rules/conditional/forbidden-if-rules.d.ts +0 -54
- package/cjs/rules/conditional/forbidden-if-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/forbidden-if-rules.js +0 -112
- package/cjs/rules/conditional/forbidden-if-rules.js.map +0 -1
- package/cjs/rules/conditional/index.d.ts +0 -10
- package/cjs/rules/conditional/index.d.ts.map +0 -1
- package/cjs/rules/conditional/present-if-rules.d.ts +0 -45
- package/cjs/rules/conditional/present-if-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/present-if-rules.js +0 -98
- package/cjs/rules/conditional/present-if-rules.js.map +0 -1
- package/cjs/rules/conditional/present-unless-rules.d.ts +0 -11
- package/cjs/rules/conditional/present-unless-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/present-unless-rules.js +0 -20
- package/cjs/rules/conditional/present-unless-rules.js.map +0 -1
- package/cjs/rules/conditional/present-with-rules.d.ts +0 -26
- package/cjs/rules/conditional/present-with-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/present-with-rules.js +0 -63
- package/cjs/rules/conditional/present-with-rules.js.map +0 -1
- package/cjs/rules/conditional/present-without-rules.d.ts +0 -26
- package/cjs/rules/conditional/present-without-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/present-without-rules.js +0 -63
- package/cjs/rules/conditional/present-without-rules.js.map +0 -1
- package/cjs/rules/conditional/required-if-rules.d.ts +0 -45
- package/cjs/rules/conditional/required-if-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/required-if-rules.js +0 -98
- package/cjs/rules/conditional/required-if-rules.js.map +0 -1
- package/cjs/rules/conditional/required-unless-rules.d.ts +0 -11
- package/cjs/rules/conditional/required-unless-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/required-unless-rules.js +0 -20
- package/cjs/rules/conditional/required-unless-rules.js.map +0 -1
- package/cjs/rules/conditional/required-with-rules.d.ts +0 -26
- package/cjs/rules/conditional/required-with-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/required-with-rules.js +0 -63
- package/cjs/rules/conditional/required-with-rules.js.map +0 -1
- package/cjs/rules/conditional/required-without-rules.d.ts +0 -26
- package/cjs/rules/conditional/required-without-rules.d.ts.map +0 -1
- package/cjs/rules/conditional/required-without-rules.js +0 -63
- package/cjs/rules/conditional/required-without-rules.js.map +0 -1
- package/cjs/rules/core/equal.d.ts +0 -8
- package/cjs/rules/core/equal.d.ts.map +0 -1
- package/cjs/rules/core/equal.js +0 -13
- package/cjs/rules/core/equal.js.map +0 -1
- package/cjs/rules/core/forbidden.d.ts +0 -6
- package/cjs/rules/core/forbidden.d.ts.map +0 -1
- package/cjs/rules/core/forbidden.js +0 -13
- package/cjs/rules/core/forbidden.js.map +0 -1
- package/cjs/rules/core/index.d.ts +0 -6
- package/cjs/rules/core/index.d.ts.map +0 -1
- package/cjs/rules/core/required.d.ts +0 -11
- package/cjs/rules/core/required.d.ts.map +0 -1
- package/cjs/rules/core/required.js +0 -31
- package/cjs/rules/core/required.js.map +0 -1
- package/cjs/rules/core/union.d.ts +0 -9
- package/cjs/rules/core/union.d.ts.map +0 -1
- package/cjs/rules/core/union.js +0 -40
- package/cjs/rules/core/union.js.map +0 -1
- package/cjs/rules/core/when.d.ts +0 -6
- package/cjs/rules/core/when.d.ts.map +0 -1
- package/cjs/rules/core/when.js +0 -40
- package/cjs/rules/core/when.js.map +0 -1
- package/cjs/rules/date/date-comparison-rules.d.ts +0 -25
- package/cjs/rules/date/date-comparison-rules.d.ts.map +0 -1
- package/cjs/rules/date/date-comparison-rules.js +0 -78
- package/cjs/rules/date/date-comparison-rules.js.map +0 -1
- package/cjs/rules/date/date-day-rules.d.ts +0 -21
- package/cjs/rules/date/date-day-rules.d.ts.map +0 -1
- package/cjs/rules/date/date-day-rules.js +0 -65
- package/cjs/rules/date/date-day-rules.js.map +0 -1
- package/cjs/rules/date/date-field-comparison-rules.d.ts +0 -28
- package/cjs/rules/date/date-field-comparison-rules.d.ts.map +0 -1
- package/cjs/rules/date/date-field-comparison-rules.js +0 -90
- package/cjs/rules/date/date-field-comparison-rules.js.map +0 -1
- package/cjs/rules/date/date-period-rules.d.ts +0 -108
- package/cjs/rules/date/date-period-rules.d.ts.map +0 -1
- package/cjs/rules/date/date-period-rules.js +0 -566
- package/cjs/rules/date/date-period-rules.js.map +0 -1
- package/cjs/rules/date/date-relative-rules.d.ts +0 -20
- package/cjs/rules/date/date-relative-rules.d.ts.map +0 -1
- package/cjs/rules/date/date-relative-rules.js +0 -57
- package/cjs/rules/date/date-relative-rules.js.map +0 -1
- package/cjs/rules/date/date-special-rules.d.ts +0 -20
- package/cjs/rules/date/date-special-rules.d.ts.map +0 -1
- package/cjs/rules/date/date-special-rules.js +0 -72
- package/cjs/rules/date/date-special-rules.js.map +0 -1
- package/cjs/rules/date/date.d.ts +0 -93
- package/cjs/rules/date/date.d.ts.map +0 -1
- package/cjs/rules/date/date.js +0 -279
- package/cjs/rules/date/date.js.map +0 -1
- package/cjs/rules/date/index.d.ts +0 -8
- package/cjs/rules/date/index.d.ts.map +0 -1
- package/cjs/rules/file/dimensions.d.ts +0 -26
- package/cjs/rules/file/dimensions.d.ts.map +0 -1
- package/cjs/rules/file/dimensions.js +0 -56
- package/cjs/rules/file/dimensions.js.map +0 -1
- package/cjs/rules/file/file-size.d.ts +0 -14
- package/cjs/rules/file/file-size.d.ts.map +0 -1
- package/cjs/rules/file/file-size.js +0 -26
- package/cjs/rules/file/file-size.js.map +0 -1
- package/cjs/rules/file/index.d.ts +0 -11
- package/cjs/rules/file/index.d.ts.map +0 -1
- package/cjs/rules/index.d.ts +0 -19
- package/cjs/rules/index.d.ts.map +0 -1
- package/cjs/rules/length/index.d.ts +0 -2
- package/cjs/rules/length/index.d.ts.map +0 -1
- package/cjs/rules/length/length-rules.d.ts +0 -49
- package/cjs/rules/length/length-rules.d.ts.map +0 -1
- package/cjs/rules/length/length-rules.js +0 -116
- package/cjs/rules/length/length-rules.js.map +0 -1
- package/cjs/rules/number/index.d.ts +0 -2
- package/cjs/rules/number/index.d.ts.map +0 -1
- package/cjs/rules/number/number-rules.d.ts +0 -65
- package/cjs/rules/number/number-rules.d.ts.map +0 -1
- package/cjs/rules/number/number-rules.js +0 -234
- package/cjs/rules/number/number-rules.js.map +0 -1
- package/cjs/rules/scalar/accepted-rule.d.ts +0 -39
- package/cjs/rules/scalar/accepted-rule.d.ts.map +0 -1
- package/cjs/rules/scalar/accepted-rule.js +0 -110
- package/cjs/rules/scalar/accepted-rule.js.map +0 -1
- package/cjs/rules/scalar/declined-rule.d.ts +0 -39
- package/cjs/rules/scalar/declined-rule.d.ts.map +0 -1
- package/cjs/rules/scalar/declined-rule.js +0 -110
- package/cjs/rules/scalar/declined-rule.js.map +0 -1
- package/cjs/rules/scalar/index.d.ts +0 -3
- package/cjs/rules/scalar/index.d.ts.map +0 -1
- package/cjs/rules/string/alpha.d.ts +0 -14
- package/cjs/rules/string/alpha.d.ts.map +0 -1
- package/cjs/rules/string/alpha.js +0 -39
- package/cjs/rules/string/alpha.js.map +0 -1
- package/cjs/rules/string/credit-card.d.ts +0 -6
- package/cjs/rules/string/credit-card.d.ts.map +0 -1
- package/cjs/rules/string/credit-card.js +0 -31
- package/cjs/rules/string/credit-card.js.map +0 -1
- package/cjs/rules/string/email.d.ts +0 -6
- package/cjs/rules/string/email.d.ts.map +0 -1
- package/cjs/rules/string/email.js +0 -13
- package/cjs/rules/string/email.js.map +0 -1
- package/cjs/rules/string/index.d.ts +0 -17
- package/cjs/rules/string/index.d.ts.map +0 -1
- package/cjs/rules/string/ip.d.ts +0 -14
- package/cjs/rules/string/ip.d.ts.map +0 -1
- package/cjs/rules/string/ip.js +0 -39
- package/cjs/rules/string/ip.js.map +0 -1
- package/cjs/rules/string/matches.d.ts +0 -8
- package/cjs/rules/string/matches.d.ts.map +0 -1
- package/cjs/rules/string/matches.js +0 -14
- package/cjs/rules/string/matches.js.map +0 -1
- package/cjs/rules/string/pattern.d.ts +0 -8
- package/cjs/rules/string/pattern.d.ts.map +0 -1
- package/cjs/rules/string/pattern.js +0 -13
- package/cjs/rules/string/pattern.js.map +0 -1
- package/cjs/rules/string/string-comparison.d.ts +0 -26
- package/cjs/rules/string/string-comparison.d.ts.map +0 -1
- package/cjs/rules/string/string-comparison.js +0 -52
- package/cjs/rules/string/string-comparison.js.map +0 -1
- package/cjs/rules/string/strong-password-rule.d.ts +0 -14
- package/cjs/rules/string/strong-password-rule.d.ts.map +0 -1
- package/cjs/rules/string/strong-password-rule.js +0 -38
- package/cjs/rules/string/strong-password-rule.js.map +0 -1
- package/cjs/rules/string/url.d.ts +0 -6
- package/cjs/rules/string/url.d.ts.map +0 -1
- package/cjs/rules/string/url.js +0 -16
- package/cjs/rules/string/url.js.map +0 -1
- package/cjs/rules/string/without-whitespace.d.ts +0 -6
- package/cjs/rules/string/without-whitespace.d.ts.map +0 -1
- package/cjs/rules/string/without-whitespace.js +0 -13
- package/cjs/rules/string/without-whitespace.js.map +0 -1
- package/cjs/types/conditional-types.d.ts +0 -15
- package/cjs/types/conditional-types.d.ts.map +0 -1
- package/cjs/types/context-types.d.ts +0 -44
- package/cjs/types/context-types.d.ts.map +0 -1
- package/cjs/types/data-transformer-types.d.ts +0 -25
- package/cjs/types/data-transformer-types.d.ts.map +0 -1
- package/cjs/types/date-types.d.ts +0 -9
- package/cjs/types/date-types.d.ts.map +0 -1
- package/cjs/types/date-types.js +0 -12
- package/cjs/types/date-types.js.map +0 -1
- package/cjs/types/index.d.ts +0 -10
- package/cjs/types/index.d.ts.map +0 -1
- package/cjs/types/inference-types.d.ts +0 -29
- package/cjs/types/inference-types.d.ts.map +0 -1
- package/cjs/types/mutator-types.d.ts +0 -27
- package/cjs/types/mutator-types.d.ts.map +0 -1
- package/cjs/types/result-types.d.ts +0 -19
- package/cjs/types/result-types.d.ts.map +0 -1
- package/cjs/types/rule-types.d.ts +0 -54
- package/cjs/types/rule-types.d.ts.map +0 -1
- package/cjs/types/schema-types.d.ts +0 -6
- package/cjs/types/schema-types.d.ts.map +0 -1
- package/cjs/validators/any-validator.d.ts +0 -7
- package/cjs/validators/any-validator.d.ts.map +0 -1
- package/cjs/validators/any-validator.js +0 -5
- package/cjs/validators/any-validator.js.map +0 -1
- package/cjs/validators/array-validator.d.ts +0 -59
- package/cjs/validators/array-validator.d.ts.map +0 -1
- package/cjs/validators/array-validator.js +0 -134
- package/cjs/validators/array-validator.js.map +0 -1
- package/cjs/validators/base-validator.d.ts +0 -609
- package/cjs/validators/base-validator.d.ts.map +0 -1
- package/cjs/validators/base-validator.js +0 -1154
- package/cjs/validators/base-validator.js.map +0 -1
- package/cjs/validators/boolean-validator.d.ts +0 -47
- package/cjs/validators/boolean-validator.d.ts.map +0 -1
- package/cjs/validators/boolean-validator.js +0 -54
- package/cjs/validators/boolean-validator.js.map +0 -1
- package/cjs/validators/date-validator.d.ts +0 -307
- package/cjs/validators/date-validator.d.ts.map +0 -1
- package/cjs/validators/date-validator.js +0 -645
- package/cjs/validators/date-validator.js.map +0 -1
- package/cjs/validators/float-validator.d.ts +0 -8
- package/cjs/validators/float-validator.d.ts.map +0 -1
- package/cjs/validators/float-validator.js +0 -9
- package/cjs/validators/float-validator.js.map +0 -1
- package/cjs/validators/index.d.ts +0 -24
- package/cjs/validators/index.d.ts.map +0 -1
- package/cjs/validators/int-validator.d.ts +0 -8
- package/cjs/validators/int-validator.d.ts.map +0 -1
- package/cjs/validators/int-validator.js +0 -9
- package/cjs/validators/int-validator.js.map +0 -1
- package/cjs/validators/number-validator.d.ts +0 -113
- package/cjs/validators/number-validator.d.ts.map +0 -1
- package/cjs/validators/number-validator.js +0 -192
- package/cjs/validators/number-validator.js.map +0 -1
- package/cjs/validators/numeric-validator.d.ts +0 -15
- package/cjs/validators/numeric-validator.d.ts.map +0 -1
- package/cjs/validators/numeric-validator.js +0 -18
- package/cjs/validators/numeric-validator.js.map +0 -1
- package/cjs/validators/object-validator.d.ts +0 -178
- package/cjs/validators/object-validator.d.ts.map +0 -1
- package/cjs/validators/object-validator.js +0 -356
- package/cjs/validators/object-validator.js.map +0 -1
- package/cjs/validators/record-validator.d.ts +0 -33
- package/cjs/validators/record-validator.d.ts.map +0 -1
- package/cjs/validators/record-validator.js +0 -70
- package/cjs/validators/record-validator.js.map +0 -1
- package/cjs/validators/scalar-validator.d.ts +0 -82
- package/cjs/validators/scalar-validator.d.ts.map +0 -1
- package/cjs/validators/scalar-validator.js +0 -160
- package/cjs/validators/scalar-validator.js.map +0 -1
- package/cjs/validators/string-validator.d.ts +0 -191
- package/cjs/validators/string-validator.d.ts.map +0 -1
- package/cjs/validators/string-validator.js +0 -410
- package/cjs/validators/string-validator.js.map +0 -1
- package/cjs/validators/tuple-validator.d.ts +0 -34
- package/cjs/validators/tuple-validator.d.ts.map +0 -1
- package/cjs/validators/tuple-validator.js +0 -79
- package/cjs/validators/tuple-validator.js.map +0 -1
- package/cjs/validators/union-validator.d.ts +0 -42
- package/cjs/validators/union-validator.d.ts.map +0 -1
- package/cjs/validators/union-validator.js +0 -44
- package/cjs/validators/union-validator.js.map +0 -1
- package/esm/config.d.ts +0 -48
- package/esm/config.d.ts.map +0 -1
- package/esm/config.js +0 -42
- package/esm/config.js.map +0 -1
- package/esm/factory/index.d.ts +0 -3
- package/esm/factory/index.d.ts.map +0 -1
- package/esm/factory/validate.d.ts +0 -8
- package/esm/factory/validate.d.ts.map +0 -1
- package/esm/factory/validate.js +0 -21
- package/esm/factory/validate.js.map +0 -1
- package/esm/factory/validators.d.ts +0 -36
- package/esm/factory/validators.d.ts.map +0 -1
- package/esm/factory/validators.js +0 -39
- package/esm/factory/validators.js.map +0 -1
- package/esm/helpers/date-helpers.d.ts +0 -16
- package/esm/helpers/date-helpers.d.ts.map +0 -1
- package/esm/helpers/date-helpers.js +0 -20
- package/esm/helpers/date-helpers.js.map +0 -1
- package/esm/helpers/get-field-value.d.ts +0 -37
- package/esm/helpers/get-field-value.d.ts.map +0 -1
- package/esm/helpers/get-field-value.js +0 -40
- package/esm/helpers/get-field-value.js.map +0 -1
- package/esm/helpers/index.d.ts +0 -5
- package/esm/helpers/index.d.ts.map +0 -1
- package/esm/helpers/path-helpers.d.ts +0 -5
- package/esm/helpers/path-helpers.d.ts.map +0 -1
- package/esm/helpers/path-helpers.js +0 -8
- package/esm/helpers/path-helpers.js.map +0 -1
- package/esm/helpers/validation-helpers.d.ts +0 -4
- package/esm/helpers/validation-helpers.d.ts.map +0 -1
- package/esm/helpers/validation-helpers.js +0 -48
- package/esm/helpers/validation-helpers.js.map +0 -1
- package/esm/index.d.ts +0 -29
- package/esm/index.d.ts.map +0 -1
- package/esm/mutators/array-mutators.d.ts +0 -12
- package/esm/mutators/array-mutators.d.ts.map +0 -1
- package/esm/mutators/array-mutators.js +0 -37
- package/esm/mutators/array-mutators.js.map +0 -1
- package/esm/mutators/date-mutators.d.ts +0 -39
- package/esm/mutators/date-mutators.d.ts.map +0 -1
- package/esm/mutators/date-mutators.js +0 -120
- package/esm/mutators/date-mutators.js.map +0 -1
- package/esm/mutators/index.d.ts +0 -7
- package/esm/mutators/index.d.ts.map +0 -1
- package/esm/mutators/number-mutators.d.ts +0 -9
- package/esm/mutators/number-mutators.d.ts.map +0 -1
- package/esm/mutators/number-mutators.js +0 -23
- package/esm/mutators/number-mutators.js.map +0 -1
- package/esm/mutators/object-mutators.d.ts +0 -8
- package/esm/mutators/object-mutators.d.ts.map +0 -1
- package/esm/mutators/object-mutators.js +0 -50
- package/esm/mutators/object-mutators.js.map +0 -1
- package/esm/mutators/scalar-mutators.d.ts +0 -3
- package/esm/mutators/scalar-mutators.d.ts.map +0 -1
- package/esm/mutators/scalar-mutators.js +0 -6
- package/esm/mutators/scalar-mutators.js.map +0 -1
- package/esm/mutators/string-mutators.d.ts +0 -72
- package/esm/mutators/string-mutators.d.ts.map +0 -1
- package/esm/mutators/string-mutators.js +0 -193
- package/esm/mutators/string-mutators.js.map +0 -1
- package/esm/plugins/index.d.ts +0 -7
- package/esm/plugins/index.d.ts.map +0 -1
- package/esm/plugins/plugin-system.d.ts +0 -71
- package/esm/plugins/plugin-system.d.ts.map +0 -1
- package/esm/plugins/plugin-system.js +0 -68
- package/esm/plugins/plugin-system.js.map +0 -1
- package/esm/rules/array/array-rules.d.ts +0 -12
- package/esm/rules/array/array-rules.d.ts.map +0 -1
- package/esm/rules/array/array-rules.js +0 -44
- package/esm/rules/array/array-rules.js.map +0 -1
- package/esm/rules/array/index.d.ts +0 -2
- package/esm/rules/array/index.d.ts.map +0 -1
- package/esm/rules/color/color-rules.d.ts +0 -30
- package/esm/rules/color/color-rules.d.ts.map +0 -1
- package/esm/rules/color/color-rules.js +0 -120
- package/esm/rules/color/color-rules.js.map +0 -1
- package/esm/rules/color/index.d.ts +0 -2
- package/esm/rules/color/index.d.ts.map +0 -1
- package/esm/rules/common/enum.d.ts +0 -26
- package/esm/rules/common/enum.d.ts.map +0 -1
- package/esm/rules/common/enum.js +0 -55
- package/esm/rules/common/enum.js.map +0 -1
- package/esm/rules/common/equals-field-rules.d.ts +0 -18
- package/esm/rules/common/equals-field-rules.d.ts.map +0 -1
- package/esm/rules/common/equals-field-rules.js +0 -38
- package/esm/rules/common/equals-field-rules.js.map +0 -1
- package/esm/rules/common/index.d.ts +0 -5
- package/esm/rules/common/index.d.ts.map +0 -1
- package/esm/rules/common/type-rules.d.ts +0 -34
- package/esm/rules/common/type-rules.d.ts.map +0 -1
- package/esm/rules/common/type-rules.js +0 -104
- package/esm/rules/common/type-rules.js.map +0 -1
- package/esm/rules/common/unknown-key.d.ts +0 -9
- package/esm/rules/common/unknown-key.d.ts.map +0 -1
- package/esm/rules/common/unknown-key.js +0 -20
- package/esm/rules/common/unknown-key.js.map +0 -1
- package/esm/rules/conditional/forbidden-if-rules.d.ts +0 -54
- package/esm/rules/conditional/forbidden-if-rules.d.ts.map +0 -1
- package/esm/rules/conditional/forbidden-if-rules.js +0 -112
- package/esm/rules/conditional/forbidden-if-rules.js.map +0 -1
- package/esm/rules/conditional/index.d.ts +0 -10
- package/esm/rules/conditional/index.d.ts.map +0 -1
- package/esm/rules/conditional/present-if-rules.d.ts +0 -45
- package/esm/rules/conditional/present-if-rules.d.ts.map +0 -1
- package/esm/rules/conditional/present-if-rules.js +0 -98
- package/esm/rules/conditional/present-if-rules.js.map +0 -1
- package/esm/rules/conditional/present-unless-rules.d.ts +0 -11
- package/esm/rules/conditional/present-unless-rules.d.ts.map +0 -1
- package/esm/rules/conditional/present-unless-rules.js +0 -20
- package/esm/rules/conditional/present-unless-rules.js.map +0 -1
- package/esm/rules/conditional/present-with-rules.d.ts +0 -26
- package/esm/rules/conditional/present-with-rules.d.ts.map +0 -1
- package/esm/rules/conditional/present-with-rules.js +0 -63
- package/esm/rules/conditional/present-with-rules.js.map +0 -1
- package/esm/rules/conditional/present-without-rules.d.ts +0 -26
- package/esm/rules/conditional/present-without-rules.d.ts.map +0 -1
- package/esm/rules/conditional/present-without-rules.js +0 -63
- package/esm/rules/conditional/present-without-rules.js.map +0 -1
- package/esm/rules/conditional/required-if-rules.d.ts +0 -45
- package/esm/rules/conditional/required-if-rules.d.ts.map +0 -1
- package/esm/rules/conditional/required-if-rules.js +0 -98
- package/esm/rules/conditional/required-if-rules.js.map +0 -1
- package/esm/rules/conditional/required-unless-rules.d.ts +0 -11
- package/esm/rules/conditional/required-unless-rules.d.ts.map +0 -1
- package/esm/rules/conditional/required-unless-rules.js +0 -20
- package/esm/rules/conditional/required-unless-rules.js.map +0 -1
- package/esm/rules/conditional/required-with-rules.d.ts +0 -26
- package/esm/rules/conditional/required-with-rules.d.ts.map +0 -1
- package/esm/rules/conditional/required-with-rules.js +0 -63
- package/esm/rules/conditional/required-with-rules.js.map +0 -1
- package/esm/rules/conditional/required-without-rules.d.ts +0 -26
- package/esm/rules/conditional/required-without-rules.d.ts.map +0 -1
- package/esm/rules/conditional/required-without-rules.js +0 -63
- package/esm/rules/conditional/required-without-rules.js.map +0 -1
- package/esm/rules/core/equal.d.ts +0 -8
- package/esm/rules/core/equal.d.ts.map +0 -1
- package/esm/rules/core/equal.js +0 -13
- package/esm/rules/core/equal.js.map +0 -1
- package/esm/rules/core/forbidden.d.ts +0 -6
- package/esm/rules/core/forbidden.d.ts.map +0 -1
- package/esm/rules/core/forbidden.js +0 -13
- package/esm/rules/core/forbidden.js.map +0 -1
- package/esm/rules/core/index.d.ts +0 -6
- package/esm/rules/core/index.d.ts.map +0 -1
- package/esm/rules/core/required.d.ts +0 -11
- package/esm/rules/core/required.d.ts.map +0 -1
- package/esm/rules/core/required.js +0 -31
- package/esm/rules/core/required.js.map +0 -1
- package/esm/rules/core/union.d.ts +0 -9
- package/esm/rules/core/union.d.ts.map +0 -1
- package/esm/rules/core/union.js +0 -40
- package/esm/rules/core/union.js.map +0 -1
- package/esm/rules/core/when.d.ts +0 -6
- package/esm/rules/core/when.d.ts.map +0 -1
- package/esm/rules/core/when.js +0 -40
- package/esm/rules/core/when.js.map +0 -1
- package/esm/rules/date/date-comparison-rules.d.ts +0 -25
- package/esm/rules/date/date-comparison-rules.d.ts.map +0 -1
- package/esm/rules/date/date-comparison-rules.js +0 -78
- package/esm/rules/date/date-comparison-rules.js.map +0 -1
- package/esm/rules/date/date-day-rules.d.ts +0 -21
- package/esm/rules/date/date-day-rules.d.ts.map +0 -1
- package/esm/rules/date/date-day-rules.js +0 -65
- package/esm/rules/date/date-day-rules.js.map +0 -1
- package/esm/rules/date/date-field-comparison-rules.d.ts +0 -28
- package/esm/rules/date/date-field-comparison-rules.d.ts.map +0 -1
- package/esm/rules/date/date-field-comparison-rules.js +0 -90
- package/esm/rules/date/date-field-comparison-rules.js.map +0 -1
- package/esm/rules/date/date-period-rules.d.ts +0 -108
- package/esm/rules/date/date-period-rules.d.ts.map +0 -1
- package/esm/rules/date/date-period-rules.js +0 -566
- package/esm/rules/date/date-period-rules.js.map +0 -1
- package/esm/rules/date/date-relative-rules.d.ts +0 -20
- package/esm/rules/date/date-relative-rules.d.ts.map +0 -1
- package/esm/rules/date/date-relative-rules.js +0 -57
- package/esm/rules/date/date-relative-rules.js.map +0 -1
- package/esm/rules/date/date-special-rules.d.ts +0 -20
- package/esm/rules/date/date-special-rules.d.ts.map +0 -1
- package/esm/rules/date/date-special-rules.js +0 -72
- package/esm/rules/date/date-special-rules.js.map +0 -1
- package/esm/rules/date/date.d.ts +0 -93
- package/esm/rules/date/date.d.ts.map +0 -1
- package/esm/rules/date/date.js +0 -279
- package/esm/rules/date/date.js.map +0 -1
- package/esm/rules/date/index.d.ts +0 -8
- package/esm/rules/date/index.d.ts.map +0 -1
- package/esm/rules/file/dimensions.d.ts +0 -26
- package/esm/rules/file/dimensions.d.ts.map +0 -1
- package/esm/rules/file/dimensions.js +0 -56
- package/esm/rules/file/dimensions.js.map +0 -1
- package/esm/rules/file/file-size.d.ts +0 -14
- package/esm/rules/file/file-size.d.ts.map +0 -1
- package/esm/rules/file/file-size.js +0 -26
- package/esm/rules/file/file-size.js.map +0 -1
- package/esm/rules/file/index.d.ts +0 -11
- package/esm/rules/file/index.d.ts.map +0 -1
- package/esm/rules/index.d.ts +0 -19
- package/esm/rules/index.d.ts.map +0 -1
- package/esm/rules/length/index.d.ts +0 -2
- package/esm/rules/length/index.d.ts.map +0 -1
- package/esm/rules/length/length-rules.d.ts +0 -49
- package/esm/rules/length/length-rules.d.ts.map +0 -1
- package/esm/rules/length/length-rules.js +0 -116
- package/esm/rules/length/length-rules.js.map +0 -1
- package/esm/rules/number/index.d.ts +0 -2
- package/esm/rules/number/index.d.ts.map +0 -1
- package/esm/rules/number/number-rules.d.ts +0 -65
- package/esm/rules/number/number-rules.d.ts.map +0 -1
- package/esm/rules/number/number-rules.js +0 -234
- package/esm/rules/number/number-rules.js.map +0 -1
- package/esm/rules/scalar/accepted-rule.d.ts +0 -39
- package/esm/rules/scalar/accepted-rule.d.ts.map +0 -1
- package/esm/rules/scalar/accepted-rule.js +0 -110
- package/esm/rules/scalar/accepted-rule.js.map +0 -1
- package/esm/rules/scalar/declined-rule.d.ts +0 -39
- package/esm/rules/scalar/declined-rule.d.ts.map +0 -1
- package/esm/rules/scalar/declined-rule.js +0 -110
- package/esm/rules/scalar/declined-rule.js.map +0 -1
- package/esm/rules/scalar/index.d.ts +0 -3
- package/esm/rules/scalar/index.d.ts.map +0 -1
- package/esm/rules/string/alpha.d.ts +0 -14
- package/esm/rules/string/alpha.d.ts.map +0 -1
- package/esm/rules/string/alpha.js +0 -39
- package/esm/rules/string/alpha.js.map +0 -1
- package/esm/rules/string/credit-card.d.ts +0 -6
- package/esm/rules/string/credit-card.d.ts.map +0 -1
- package/esm/rules/string/credit-card.js +0 -31
- package/esm/rules/string/credit-card.js.map +0 -1
- package/esm/rules/string/email.d.ts +0 -6
- package/esm/rules/string/email.d.ts.map +0 -1
- package/esm/rules/string/email.js +0 -13
- package/esm/rules/string/email.js.map +0 -1
- package/esm/rules/string/index.d.ts +0 -17
- package/esm/rules/string/index.d.ts.map +0 -1
- package/esm/rules/string/ip.d.ts +0 -14
- package/esm/rules/string/ip.d.ts.map +0 -1
- package/esm/rules/string/ip.js +0 -39
- package/esm/rules/string/ip.js.map +0 -1
- package/esm/rules/string/matches.d.ts +0 -8
- package/esm/rules/string/matches.d.ts.map +0 -1
- package/esm/rules/string/matches.js +0 -14
- package/esm/rules/string/matches.js.map +0 -1
- package/esm/rules/string/pattern.d.ts +0 -8
- package/esm/rules/string/pattern.d.ts.map +0 -1
- package/esm/rules/string/pattern.js +0 -13
- package/esm/rules/string/pattern.js.map +0 -1
- package/esm/rules/string/string-comparison.d.ts +0 -26
- package/esm/rules/string/string-comparison.d.ts.map +0 -1
- package/esm/rules/string/string-comparison.js +0 -52
- package/esm/rules/string/string-comparison.js.map +0 -1
- package/esm/rules/string/strong-password-rule.d.ts +0 -14
- package/esm/rules/string/strong-password-rule.d.ts.map +0 -1
- package/esm/rules/string/strong-password-rule.js +0 -38
- package/esm/rules/string/strong-password-rule.js.map +0 -1
- package/esm/rules/string/url.d.ts +0 -6
- package/esm/rules/string/url.d.ts.map +0 -1
- package/esm/rules/string/url.js +0 -16
- package/esm/rules/string/url.js.map +0 -1
- package/esm/rules/string/without-whitespace.d.ts +0 -6
- package/esm/rules/string/without-whitespace.d.ts.map +0 -1
- package/esm/rules/string/without-whitespace.js +0 -13
- package/esm/rules/string/without-whitespace.js.map +0 -1
- package/esm/types/conditional-types.d.ts +0 -15
- package/esm/types/conditional-types.d.ts.map +0 -1
- package/esm/types/context-types.d.ts +0 -44
- package/esm/types/context-types.d.ts.map +0 -1
- package/esm/types/data-transformer-types.d.ts +0 -25
- package/esm/types/data-transformer-types.d.ts.map +0 -1
- package/esm/types/date-types.d.ts +0 -9
- package/esm/types/date-types.d.ts.map +0 -1
- package/esm/types/date-types.js +0 -12
- package/esm/types/date-types.js.map +0 -1
- package/esm/types/index.d.ts +0 -10
- package/esm/types/index.d.ts.map +0 -1
- package/esm/types/inference-types.d.ts +0 -29
- package/esm/types/inference-types.d.ts.map +0 -1
- package/esm/types/mutator-types.d.ts +0 -27
- package/esm/types/mutator-types.d.ts.map +0 -1
- package/esm/types/result-types.d.ts +0 -19
- package/esm/types/result-types.d.ts.map +0 -1
- package/esm/types/rule-types.d.ts +0 -54
- package/esm/types/rule-types.d.ts.map +0 -1
- package/esm/types/schema-types.d.ts +0 -6
- package/esm/types/schema-types.d.ts.map +0 -1
- package/esm/validators/any-validator.d.ts +0 -7
- package/esm/validators/any-validator.d.ts.map +0 -1
- package/esm/validators/any-validator.js +0 -5
- package/esm/validators/any-validator.js.map +0 -1
- package/esm/validators/array-validator.d.ts +0 -59
- package/esm/validators/array-validator.d.ts.map +0 -1
- package/esm/validators/array-validator.js +0 -134
- package/esm/validators/array-validator.js.map +0 -1
- package/esm/validators/base-validator.d.ts +0 -609
- package/esm/validators/base-validator.d.ts.map +0 -1
- package/esm/validators/base-validator.js +0 -1154
- package/esm/validators/base-validator.js.map +0 -1
- package/esm/validators/boolean-validator.d.ts +0 -47
- package/esm/validators/boolean-validator.d.ts.map +0 -1
- package/esm/validators/boolean-validator.js +0 -54
- package/esm/validators/boolean-validator.js.map +0 -1
- package/esm/validators/date-validator.d.ts +0 -307
- package/esm/validators/date-validator.d.ts.map +0 -1
- package/esm/validators/date-validator.js +0 -645
- package/esm/validators/date-validator.js.map +0 -1
- package/esm/validators/float-validator.d.ts +0 -8
- package/esm/validators/float-validator.d.ts.map +0 -1
- package/esm/validators/float-validator.js +0 -9
- package/esm/validators/float-validator.js.map +0 -1
- package/esm/validators/index.d.ts +0 -24
- package/esm/validators/index.d.ts.map +0 -1
- package/esm/validators/int-validator.d.ts +0 -8
- package/esm/validators/int-validator.d.ts.map +0 -1
- package/esm/validators/int-validator.js +0 -9
- package/esm/validators/int-validator.js.map +0 -1
- package/esm/validators/number-validator.d.ts +0 -113
- package/esm/validators/number-validator.d.ts.map +0 -1
- package/esm/validators/number-validator.js +0 -192
- package/esm/validators/number-validator.js.map +0 -1
- package/esm/validators/numeric-validator.d.ts +0 -15
- package/esm/validators/numeric-validator.d.ts.map +0 -1
- package/esm/validators/numeric-validator.js +0 -18
- package/esm/validators/numeric-validator.js.map +0 -1
- package/esm/validators/object-validator.d.ts +0 -178
- package/esm/validators/object-validator.d.ts.map +0 -1
- package/esm/validators/object-validator.js +0 -356
- package/esm/validators/object-validator.js.map +0 -1
- package/esm/validators/record-validator.d.ts +0 -33
- package/esm/validators/record-validator.d.ts.map +0 -1
- package/esm/validators/record-validator.js +0 -70
- package/esm/validators/record-validator.js.map +0 -1
- package/esm/validators/scalar-validator.d.ts +0 -82
- package/esm/validators/scalar-validator.d.ts.map +0 -1
- package/esm/validators/scalar-validator.js +0 -160
- package/esm/validators/scalar-validator.js.map +0 -1
- package/esm/validators/string-validator.d.ts +0 -191
- package/esm/validators/string-validator.d.ts.map +0 -1
- package/esm/validators/string-validator.js +0 -410
- package/esm/validators/string-validator.js.map +0 -1
- package/esm/validators/tuple-validator.d.ts +0 -34
- package/esm/validators/tuple-validator.d.ts.map +0 -1
- package/esm/validators/tuple-validator.js +0 -79
- package/esm/validators/tuple-validator.js.map +0 -1
- package/esm/validators/union-validator.d.ts +0 -42
- package/esm/validators/union-validator.d.ts.map +0 -1
- package/esm/validators/union-validator.js +0 -44
- package/esm/validators/union-validator.js.map +0 -1
|
@@ -1,609 +0,0 @@
|
|
|
1
|
-
import type { ContextualSchemaRule, ContextualizedMutator, ContextualizedTransformer, Mutator, SchemaContext, SchemaRule, SchemaRuleOptions, SimpleTransformerCallback, TransformerCallback, ValidationAttributesList, ValidationResult, WhenRuleOptions } from "../types";
|
|
2
|
-
/**
|
|
3
|
-
* Base validator class - foundation for all validators
|
|
4
|
-
*/
|
|
5
|
-
export declare class BaseValidator {
|
|
6
|
-
rules: ContextualSchemaRule[];
|
|
7
|
-
mutators: ContextualizedMutator[];
|
|
8
|
-
protected defaultValue: any;
|
|
9
|
-
protected description?: string;
|
|
10
|
-
protected shouldOmit: boolean;
|
|
11
|
-
protected isNullable: boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Pipeline to transform the mutated/original data before returning it
|
|
14
|
-
*/
|
|
15
|
-
protected dataTransformers: ContextualizedTransformer[];
|
|
16
|
-
/**
|
|
17
|
-
* Attributes text to be replaced on translations
|
|
18
|
-
* If the value is an object, it will be used as the attributes list for the rule
|
|
19
|
-
* If the value is a string, it will be used as the attributes list for the rule
|
|
20
|
-
*/
|
|
21
|
-
protected attributesText: ValidationAttributesList;
|
|
22
|
-
/**
|
|
23
|
-
* Attributed that will be always using the attribute translator
|
|
24
|
-
*/
|
|
25
|
-
protected translatedAttributes: Record<string, string>;
|
|
26
|
-
/**
|
|
27
|
-
* Get the default value
|
|
28
|
-
*/
|
|
29
|
-
getDefaultValue(): any;
|
|
30
|
-
/**
|
|
31
|
-
* Determine if value accepts null value
|
|
32
|
-
*/
|
|
33
|
-
nullable(): this;
|
|
34
|
-
/**
|
|
35
|
-
* Explicitly disallow null values after calling nullable
|
|
36
|
-
*/
|
|
37
|
-
notNullable(): this;
|
|
38
|
-
/**
|
|
39
|
-
* Add transformer with optional options
|
|
40
|
-
*
|
|
41
|
-
* @param transform - The transformer callback function
|
|
42
|
-
* @param options - Optional options to pass to the transformer
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```ts
|
|
46
|
-
* // Without options
|
|
47
|
-
* v.date().addTransformer(data => data.toISOString())
|
|
48
|
-
*
|
|
49
|
-
* // With options
|
|
50
|
-
* v.date().addTransformer(
|
|
51
|
-
* (data, { options }) => dayjs(data).format(options.format),
|
|
52
|
-
* { format: 'YYYY-MM-DD' }
|
|
53
|
-
* )
|
|
54
|
-
* ```
|
|
55
|
-
*/
|
|
56
|
-
addTransformer(transform: TransformerCallback, options?: any): this;
|
|
57
|
-
/**
|
|
58
|
-
* Transform the output value - simple one-time transformation
|
|
59
|
-
*
|
|
60
|
-
* @param callback - Simple callback receiving data and context
|
|
61
|
-
*
|
|
62
|
-
* @example
|
|
63
|
-
* ```ts
|
|
64
|
-
* // Simple transformation
|
|
65
|
-
* v.string().outputAs(data => data.toUpperCase())
|
|
66
|
-
*
|
|
67
|
-
* // With context
|
|
68
|
-
* v.string().outputAs((data, context) => {
|
|
69
|
-
* console.log(`Transforming ${context.path}`);
|
|
70
|
-
* return data.toLowerCase();
|
|
71
|
-
* })
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
outputAs(callback: SimpleTransformerCallback): this;
|
|
75
|
-
/**
|
|
76
|
-
* Transform output to JSON string
|
|
77
|
-
*
|
|
78
|
-
* Works with any validator type (string, number, date, object, array, etc.)
|
|
79
|
-
*
|
|
80
|
-
* @param indent - Optional indentation for pretty printing (default: 0 for compact)
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* ```ts
|
|
84
|
-
* // Compact JSON
|
|
85
|
-
* v.object({ name: v.string() }).toJSON()
|
|
86
|
-
* // Output: '{"name":"John"}'
|
|
87
|
-
*
|
|
88
|
-
* // Pretty-printed JSON
|
|
89
|
-
* v.array(v.object({...})).toJSON(2)
|
|
90
|
-
* // Output:
|
|
91
|
-
* // [
|
|
92
|
-
* // {
|
|
93
|
-
* // "name": "John"
|
|
94
|
-
* // }
|
|
95
|
-
* // ]
|
|
96
|
-
*
|
|
97
|
-
* // Works with any type
|
|
98
|
-
* v.string().toJSON() // '"hello"'
|
|
99
|
-
* v.number().toJSON() // '42'
|
|
100
|
-
* v.date().toJSON() // '"2024-10-26T00:00:00.000Z"'
|
|
101
|
-
* ```
|
|
102
|
-
*
|
|
103
|
-
* @category Transformer
|
|
104
|
-
*/
|
|
105
|
-
toJSON(indent?: number): this;
|
|
106
|
-
/**
|
|
107
|
-
* Start data transformation pipeline
|
|
108
|
-
* Context is passed at runtime, not stored
|
|
109
|
-
*/
|
|
110
|
-
startTransformationPipeline(data: any, context: SchemaContext): Promise<any>;
|
|
111
|
-
/**
|
|
112
|
-
* Set attributes text to be replaced on translations
|
|
113
|
-
* If the value is an object, it will be used as the attributes list for the rule
|
|
114
|
-
* If the value is a string, it will be used as the attributes list for the rule
|
|
115
|
-
*
|
|
116
|
-
* @example
|
|
117
|
-
* v.string().attributes({
|
|
118
|
-
* name: "Name",
|
|
119
|
-
* email: "Email",
|
|
120
|
-
* });
|
|
121
|
-
* // Example 2: Add custom attributes for matches
|
|
122
|
-
* v.string().matches("confirmPassword").attributes({
|
|
123
|
-
* matches: {
|
|
124
|
-
* confirmPassword: "Confirm Password",
|
|
125
|
-
* },
|
|
126
|
-
* });
|
|
127
|
-
*/
|
|
128
|
-
attributes(attributes: Record<string, string | Record<string, string>>): this;
|
|
129
|
-
/**
|
|
130
|
-
* Define a lazy getter property for each attribute in the given object and use the config attribute translator
|
|
131
|
-
*/
|
|
132
|
-
transAttributes(attributes: Record<string, string>): this;
|
|
133
|
-
/**
|
|
134
|
-
* Add description to the validator
|
|
135
|
-
*/
|
|
136
|
-
describe(description: string): this;
|
|
137
|
-
/**
|
|
138
|
-
* Check if this validator can handle the given value's type
|
|
139
|
-
* Override this in specific validators to enable type-based routing in union validators
|
|
140
|
-
*
|
|
141
|
-
* Default: returns true (validator will attempt to validate any type)
|
|
142
|
-
*
|
|
143
|
-
* @param value - The value to check
|
|
144
|
-
* @returns True if this validator can handle this type
|
|
145
|
-
*
|
|
146
|
-
* @example
|
|
147
|
-
* ```ts
|
|
148
|
-
* // StringValidator
|
|
149
|
-
* public matchesType(value: any): boolean {
|
|
150
|
-
* return typeof value === 'string';
|
|
151
|
-
* }
|
|
152
|
-
*
|
|
153
|
-
* // Custom FileValidator
|
|
154
|
-
* public matchesType(value: any): boolean {
|
|
155
|
-
* return value instanceof UploadedFile;
|
|
156
|
-
* }
|
|
157
|
-
* ```
|
|
158
|
-
*/
|
|
159
|
-
matchesType(_value: any): boolean;
|
|
160
|
-
/**
|
|
161
|
-
* Create a copy of this validator with the same configuration
|
|
162
|
-
* Copies all rules, mutators, transformers, default values, and settings
|
|
163
|
-
*
|
|
164
|
-
* @returns A new validator instance with copied configuration
|
|
165
|
-
*
|
|
166
|
-
* @example
|
|
167
|
-
* ```ts
|
|
168
|
-
* // Create reusable validator templates
|
|
169
|
-
* const baseString = v.string().required().trim().min(3);
|
|
170
|
-
* const emailField = baseString.clone().email();
|
|
171
|
-
* const usernameField = baseString.clone().alphanumeric().max(20);
|
|
172
|
-
*
|
|
173
|
-
* // Works with all validators
|
|
174
|
-
* const positiveInt = v.int().positive().required();
|
|
175
|
-
* const ageField = positiveInt.clone().min(18).max(120);
|
|
176
|
-
* ```
|
|
177
|
-
*/
|
|
178
|
-
clone(): this;
|
|
179
|
-
/**
|
|
180
|
-
* @deprecated This method is no longer needed and does nothing.
|
|
181
|
-
* Empty values are now automatically skipped for validation rules by default.
|
|
182
|
-
* Only presence validators (required, present, etc.) will check empty values.
|
|
183
|
-
* You can safely remove this call from your code.
|
|
184
|
-
*/
|
|
185
|
-
ignoreEmptyValue(_ignoreEmptyValue?: boolean): this;
|
|
186
|
-
/**
|
|
187
|
-
* Omit this field from the validated data output
|
|
188
|
-
*
|
|
189
|
-
* Field will still be validated but not included in the final result.
|
|
190
|
-
* Useful for confirmation fields, captcha, terms acceptance, etc.
|
|
191
|
-
*
|
|
192
|
-
* @example
|
|
193
|
-
* ```ts
|
|
194
|
-
* v.object({
|
|
195
|
-
* password: v.string().required(),
|
|
196
|
-
* confirmPassword: v.string().required().sameAs("password").omit(),
|
|
197
|
-
* acceptTerms: v.boolean().required().omit(),
|
|
198
|
-
* });
|
|
199
|
-
* // Output: { password: "..." }
|
|
200
|
-
* // confirmPassword and acceptTerms validated but omitted
|
|
201
|
-
* ```
|
|
202
|
-
*/
|
|
203
|
-
omit(): this;
|
|
204
|
-
/**
|
|
205
|
-
* @alias omit
|
|
206
|
-
*/
|
|
207
|
-
exclude(): this;
|
|
208
|
-
/**
|
|
209
|
-
* Check if this field should be omitted from the output
|
|
210
|
-
*/
|
|
211
|
-
isOmitted(): boolean;
|
|
212
|
-
/**
|
|
213
|
-
* Value must be equal to the given value
|
|
214
|
-
*/
|
|
215
|
-
equal(value: any, errorMessage?: string): this;
|
|
216
|
-
/**
|
|
217
|
-
* Value must be the same as another field's value
|
|
218
|
-
*/
|
|
219
|
-
sameAs(field: string, errorMessage?: string): this;
|
|
220
|
-
/**
|
|
221
|
-
* Value must be the same as another sibling field's value
|
|
222
|
-
*/
|
|
223
|
-
sameAsSibling(field: string, errorMessage?: string): this;
|
|
224
|
-
/**
|
|
225
|
-
* Value must be different from another field's value
|
|
226
|
-
*/
|
|
227
|
-
differentFrom(field: string, errorMessage?: string): this;
|
|
228
|
-
/**
|
|
229
|
-
* Value must be different from another sibling field's value
|
|
230
|
-
*/
|
|
231
|
-
differentFromSibling(field: string, errorMessage?: string): this;
|
|
232
|
-
/**
|
|
233
|
-
* Add rule to the validator
|
|
234
|
-
*/
|
|
235
|
-
addRule<T extends SchemaRuleOptions = SchemaRuleOptions>(rule: SchemaRule<T>, errorMessage?: string): ContextualSchemaRule<T>;
|
|
236
|
-
/**
|
|
237
|
-
* Use a custom or pre-built validation rule
|
|
238
|
-
*
|
|
239
|
-
* @param rule - The validation rule to apply
|
|
240
|
-
* @param options - Rule options including errorMessage and any rule-specific options
|
|
241
|
-
*
|
|
242
|
-
* @example
|
|
243
|
-
* ```ts
|
|
244
|
-
* import { hexColorRule } from "@warlock.js/seal-plugins/colors";
|
|
245
|
-
*
|
|
246
|
-
* v.string().useRule(hexColorRule, { errorMessage: "Invalid color" });
|
|
247
|
-
* ```
|
|
248
|
-
*
|
|
249
|
-
* @example
|
|
250
|
-
* ```ts
|
|
251
|
-
* // With rule options
|
|
252
|
-
* v.string().useRule(myCustomRule, {
|
|
253
|
-
* customOption: true,
|
|
254
|
-
* errorMessage: "Custom validation failed"
|
|
255
|
-
* });
|
|
256
|
-
* ```
|
|
257
|
-
*/
|
|
258
|
-
useRule<T extends SchemaRuleOptions = SchemaRuleOptions>(rule: SchemaRule<T>, options?: T & {
|
|
259
|
-
errorMessage?: string;
|
|
260
|
-
}): this;
|
|
261
|
-
/**
|
|
262
|
-
* Define custom rule
|
|
263
|
-
*/
|
|
264
|
-
refine(callback: (value: any, context: SchemaContext) => Promise<string | undefined> | string | undefined): this;
|
|
265
|
-
/**
|
|
266
|
-
* Add mutator to the validator
|
|
267
|
-
*/
|
|
268
|
-
addMutator(mutator: Mutator, options?: any): this;
|
|
269
|
-
/**
|
|
270
|
-
* Set default value for the field
|
|
271
|
-
*/
|
|
272
|
-
default(value: any): this;
|
|
273
|
-
/**
|
|
274
|
-
* This value must be present and has a value
|
|
275
|
-
*/
|
|
276
|
-
required(errorMessage?: string): this;
|
|
277
|
-
/**
|
|
278
|
-
* Value must be present but not necessarily has a value
|
|
279
|
-
*/
|
|
280
|
-
present(errorMessage?: string): this;
|
|
281
|
-
/**
|
|
282
|
-
* Mark the field as optional, so pass it if it has no value or has a value
|
|
283
|
-
* Because this is the default behavior, this method is just syntactic sugar
|
|
284
|
-
*/
|
|
285
|
-
optional(): this;
|
|
286
|
-
/**
|
|
287
|
-
* Value is required if another field exists
|
|
288
|
-
*/
|
|
289
|
-
requiredWith(field: string, errorMessage?: string): this;
|
|
290
|
-
/**
|
|
291
|
-
* Value is required if another sibling field exists
|
|
292
|
-
*/
|
|
293
|
-
requiredWithSibling(field: string, errorMessage?: string): this;
|
|
294
|
-
/**
|
|
295
|
-
* Value is required if another field is missing
|
|
296
|
-
*/
|
|
297
|
-
requiredWithout(field: string, errorMessage?: string): this;
|
|
298
|
-
/**
|
|
299
|
-
* Value is required if another sibling field is missing
|
|
300
|
-
*/
|
|
301
|
-
requiredWithoutSibling(field: string, errorMessage?: string): this;
|
|
302
|
-
/**
|
|
303
|
-
* Value is required if another field equals a specific value
|
|
304
|
-
*/
|
|
305
|
-
requiredIf(field: string, value: any, errorMessage?: string): this;
|
|
306
|
-
/**
|
|
307
|
-
* Value is required if another sibling field equals a specific value
|
|
308
|
-
*/
|
|
309
|
-
requiredIfSibling(field: string, value: any, errorMessage?: string): this;
|
|
310
|
-
/**
|
|
311
|
-
* Value is required unless another field equals a specific value
|
|
312
|
-
*/
|
|
313
|
-
requiredUnless(field: string, value: any, errorMessage?: string): this;
|
|
314
|
-
/**
|
|
315
|
-
* Value is required unless another sibling field equals a specific value
|
|
316
|
-
*/
|
|
317
|
-
requiredUnlessSibling(field: string, value: any, errorMessage?: string): this;
|
|
318
|
-
/**
|
|
319
|
-
* Value is required if another field is empty
|
|
320
|
-
*/
|
|
321
|
-
requiredIfEmpty(field: string, errorMessage?: string): this;
|
|
322
|
-
/**
|
|
323
|
-
* Value is required if another sibling field is empty
|
|
324
|
-
*/
|
|
325
|
-
requiredIfEmptySibling(field: string, errorMessage?: string): this;
|
|
326
|
-
/**
|
|
327
|
-
* Value is required if another field is not empty
|
|
328
|
-
*/
|
|
329
|
-
requiredIfNotEmpty(field: string, errorMessage?: string): this;
|
|
330
|
-
/**
|
|
331
|
-
* Value is required if another sibling field is not empty
|
|
332
|
-
*/
|
|
333
|
-
requiredIfNotEmptySibling(field: string, errorMessage?: string): this;
|
|
334
|
-
/**
|
|
335
|
-
* Value is required if another field's value is in the given array
|
|
336
|
-
*/
|
|
337
|
-
requiredIfIn(field: string, values: any[], errorMessage?: string): this;
|
|
338
|
-
/**
|
|
339
|
-
* Value is required if another sibling field's value is in the given array
|
|
340
|
-
*/
|
|
341
|
-
requiredIfInSibling(field: string, values: any[], errorMessage?: string): this;
|
|
342
|
-
/**
|
|
343
|
-
* Value is required if another field's value is NOT in the given array
|
|
344
|
-
*/
|
|
345
|
-
requiredIfNotIn(field: string, values: any[], errorMessage?: string): this;
|
|
346
|
-
/**
|
|
347
|
-
* Value is required if another sibling field's value is NOT in the given array
|
|
348
|
-
*/
|
|
349
|
-
requiredIfNotInSibling(field: string, values: any[], errorMessage?: string): this;
|
|
350
|
-
/**
|
|
351
|
-
* Value is required if all specified fields exist
|
|
352
|
-
*/
|
|
353
|
-
requiredWithAll(fields: string[], errorMessage?: string): this;
|
|
354
|
-
/**
|
|
355
|
-
* Value is required if all specified sibling fields exist
|
|
356
|
-
*/
|
|
357
|
-
requiredWithAllSiblings(fields: string[], errorMessage?: string): this;
|
|
358
|
-
/**
|
|
359
|
-
* Value is required if all specified fields are missing
|
|
360
|
-
*/
|
|
361
|
-
requiredWithoutAll(fields: string[], errorMessage?: string): this;
|
|
362
|
-
/**
|
|
363
|
-
* Value is required if all specified sibling fields are missing
|
|
364
|
-
*/
|
|
365
|
-
requiredWithoutAllSiblings(fields: string[], errorMessage?: string): this;
|
|
366
|
-
/**
|
|
367
|
-
* Value is required if any of the specified fields exists
|
|
368
|
-
*/
|
|
369
|
-
requiredWithAny(fields: string[], errorMessage?: string): this;
|
|
370
|
-
/**
|
|
371
|
-
* Value is required if any of the specified sibling fields exists
|
|
372
|
-
*/
|
|
373
|
-
requiredWithAnySiblings(fields: string[], errorMessage?: string): this;
|
|
374
|
-
/**
|
|
375
|
-
* Value is required if any of the specified fields is missing
|
|
376
|
-
*/
|
|
377
|
-
requiredWithoutAny(fields: string[], errorMessage?: string): this;
|
|
378
|
-
/**
|
|
379
|
-
* Value is required if any of the specified sibling fields is missing
|
|
380
|
-
*/
|
|
381
|
-
requiredWithoutAnySiblings(fields: string[], errorMessage?: string): this;
|
|
382
|
-
/**
|
|
383
|
-
* Field must be present if another field exists
|
|
384
|
-
*/
|
|
385
|
-
presentWith(field: string, errorMessage?: string): this;
|
|
386
|
-
/**
|
|
387
|
-
* Field must be present if another sibling field exists
|
|
388
|
-
*/
|
|
389
|
-
presentWithSibling(field: string, errorMessage?: string): this;
|
|
390
|
-
/**
|
|
391
|
-
* Field must be present if another field is missing
|
|
392
|
-
*/
|
|
393
|
-
presentWithout(field: string, errorMessage?: string): this;
|
|
394
|
-
/**
|
|
395
|
-
* Field must be present if another sibling field is missing
|
|
396
|
-
*/
|
|
397
|
-
presentWithoutSibling(field: string, errorMessage?: string): this;
|
|
398
|
-
/**
|
|
399
|
-
* Field must be present if another field equals a specific value
|
|
400
|
-
*/
|
|
401
|
-
presentIf(field: string, value: any, errorMessage?: string): this;
|
|
402
|
-
/**
|
|
403
|
-
* Field must be present if another sibling field equals a specific value
|
|
404
|
-
*/
|
|
405
|
-
presentIfSibling(field: string, value: any, errorMessage?: string): this;
|
|
406
|
-
/**
|
|
407
|
-
* Field must be present unless another field equals a specific value
|
|
408
|
-
*/
|
|
409
|
-
presentUnless(field: string, value: any, errorMessage?: string): this;
|
|
410
|
-
/**
|
|
411
|
-
* Field must be present unless another sibling field equals a specific value
|
|
412
|
-
*/
|
|
413
|
-
presentUnlessSibling(field: string, value: any, errorMessage?: string): this;
|
|
414
|
-
/**
|
|
415
|
-
* Field must be present if another field is empty
|
|
416
|
-
*/
|
|
417
|
-
presentIfEmpty(field: string, errorMessage?: string): this;
|
|
418
|
-
/**
|
|
419
|
-
* Field must be present if another sibling field is empty
|
|
420
|
-
*/
|
|
421
|
-
presentIfEmptySibling(field: string, errorMessage?: string): this;
|
|
422
|
-
/**
|
|
423
|
-
* Field must be present if another field is not empty
|
|
424
|
-
*/
|
|
425
|
-
presentIfNotEmpty(field: string, errorMessage?: string): this;
|
|
426
|
-
/**
|
|
427
|
-
* Field must be present if another sibling field is not empty
|
|
428
|
-
*/
|
|
429
|
-
presentIfNotEmptySibling(field: string, errorMessage?: string): this;
|
|
430
|
-
/**
|
|
431
|
-
* Field must be present if another field's value is in the given array
|
|
432
|
-
*/
|
|
433
|
-
presentIfIn(field: string, values: any[], errorMessage?: string): this;
|
|
434
|
-
/**
|
|
435
|
-
* Field must be present if another sibling field's value is in the given array
|
|
436
|
-
*/
|
|
437
|
-
presentIfInSibling(field: string, values: any[], errorMessage?: string): this;
|
|
438
|
-
/**
|
|
439
|
-
* Field must be present if another field's value is NOT in the given array
|
|
440
|
-
*/
|
|
441
|
-
presentIfNotIn(field: string, values: any[], errorMessage?: string): this;
|
|
442
|
-
/**
|
|
443
|
-
* Field must be present if another sibling field's value is NOT in the given array
|
|
444
|
-
*/
|
|
445
|
-
presentIfNotInSibling(field: string, values: any[], errorMessage?: string): this;
|
|
446
|
-
/**
|
|
447
|
-
* Field must be present if all specified fields exist
|
|
448
|
-
*/
|
|
449
|
-
presentWithAll(fields: string[], errorMessage?: string): this;
|
|
450
|
-
/**
|
|
451
|
-
* Field must be present if all specified sibling fields exist
|
|
452
|
-
*/
|
|
453
|
-
presentWithAllSiblings(fields: string[], errorMessage?: string): this;
|
|
454
|
-
/**
|
|
455
|
-
* Field must be present if all specified fields are missing
|
|
456
|
-
*/
|
|
457
|
-
presentWithoutAll(fields: string[], errorMessage?: string): this;
|
|
458
|
-
/**
|
|
459
|
-
* Field must be present if all specified sibling fields are missing
|
|
460
|
-
*/
|
|
461
|
-
presentWithoutAllSiblings(fields: string[], errorMessage?: string): this;
|
|
462
|
-
/**
|
|
463
|
-
* Field must be present if any of the specified fields exists
|
|
464
|
-
*/
|
|
465
|
-
presentWithAny(fields: string[], errorMessage?: string): this;
|
|
466
|
-
/**
|
|
467
|
-
* Field must be present if any of the specified sibling fields exists
|
|
468
|
-
*/
|
|
469
|
-
presentWithAnySiblings(fields: string[], errorMessage?: string): this;
|
|
470
|
-
/**
|
|
471
|
-
* Field must be present if any of the specified fields is missing
|
|
472
|
-
*/
|
|
473
|
-
presentWithoutAny(fields: string[], errorMessage?: string): this;
|
|
474
|
-
/**
|
|
475
|
-
* Field must be present if any of the specified sibling fields is missing
|
|
476
|
-
*/
|
|
477
|
-
presentWithoutAnySiblings(fields: string[], errorMessage?: string): this;
|
|
478
|
-
/**
|
|
479
|
-
* Mutate the data
|
|
480
|
-
*/
|
|
481
|
-
mutate(data: any, context: SchemaContext): Promise<any>;
|
|
482
|
-
/**
|
|
483
|
-
* Value is forbidden to be present
|
|
484
|
-
*/
|
|
485
|
-
forbidden(errorMessage?: string): this;
|
|
486
|
-
/**
|
|
487
|
-
* Value is forbidden if another field equals a specific value (global scope)
|
|
488
|
-
*/
|
|
489
|
-
forbiddenIf(field: string, value: any, errorMessage?: string): this;
|
|
490
|
-
/**
|
|
491
|
-
* Value is forbidden if another field equals a specific value (sibling scope)
|
|
492
|
-
*/
|
|
493
|
-
forbiddenIfSibling(field: string, value: any, errorMessage?: string): this;
|
|
494
|
-
/**
|
|
495
|
-
* Value is forbidden if another field does NOT equal a specific value (global scope)
|
|
496
|
-
*/
|
|
497
|
-
forbiddenIfNot(field: string, value: any, errorMessage?: string): this;
|
|
498
|
-
/**
|
|
499
|
-
* Value is forbidden if another field does NOT equal a specific value (sibling scope)
|
|
500
|
-
*/
|
|
501
|
-
forbiddenIfNotSibling(field: string, value: any, errorMessage?: string): this;
|
|
502
|
-
/**
|
|
503
|
-
* Value is forbidden if another field is empty (global scope)
|
|
504
|
-
*/
|
|
505
|
-
forbiddenIfEmpty(field: string, errorMessage?: string): this;
|
|
506
|
-
/**
|
|
507
|
-
* Value is forbidden if another field is empty (sibling scope)
|
|
508
|
-
*/
|
|
509
|
-
forbiddenIfEmptySibling(field: string, errorMessage?: string): this;
|
|
510
|
-
/**
|
|
511
|
-
* Value is forbidden if another field is not empty (global scope)
|
|
512
|
-
*/
|
|
513
|
-
forbiddenIfNotEmpty(field: string, errorMessage?: string): this;
|
|
514
|
-
/**
|
|
515
|
-
* Value is forbidden if another field is not empty (sibling scope)
|
|
516
|
-
*/
|
|
517
|
-
forbiddenIfNotEmptySibling(field: string, errorMessage?: string): this;
|
|
518
|
-
/**
|
|
519
|
-
* Value is forbidden if another field's value is in the given array (global scope)
|
|
520
|
-
*/
|
|
521
|
-
forbiddenIfIn(field: string, values: any[], errorMessage?: string): this;
|
|
522
|
-
/**
|
|
523
|
-
* Value is forbidden if another field's value is in the given array (sibling scope)
|
|
524
|
-
*/
|
|
525
|
-
forbiddenIfInSibling(field: string, values: any[], errorMessage?: string): this;
|
|
526
|
-
/**
|
|
527
|
-
* Value is forbidden if another field's value is NOT in the given array (global scope)
|
|
528
|
-
*/
|
|
529
|
-
forbiddenIfNotIn(field: string, values: any[], errorMessage?: string): this;
|
|
530
|
-
/**
|
|
531
|
-
* Value is forbidden if another field's value is NOT in the given array (sibling scope)
|
|
532
|
-
*/
|
|
533
|
-
forbiddenIfNotInSibling(field: string, values: any[], errorMessage?: string): this;
|
|
534
|
-
/**
|
|
535
|
-
* Apply different validation rules based on another field's value (global scope)
|
|
536
|
-
*
|
|
537
|
-
* Use this when you need to apply completely different validators
|
|
538
|
-
* based on another field's value (not just required/optional).
|
|
539
|
-
*
|
|
540
|
-
* @param field - Field name to check (can be nested with dot notation)
|
|
541
|
-
* @param options - Validation options per field value
|
|
542
|
-
*
|
|
543
|
-
* @example
|
|
544
|
-
* ```ts
|
|
545
|
-
* // Different allowed values based on user type
|
|
546
|
-
* v.object({
|
|
547
|
-
* userType: v.string().in(['admin', 'user']),
|
|
548
|
-
* role: v.string().when('userType', {
|
|
549
|
-
* is: {
|
|
550
|
-
* admin: v.string().in(['super', 'moderator']),
|
|
551
|
-
* user: v.string().in(['member', 'guest'])
|
|
552
|
-
* },
|
|
553
|
-
* otherwise: v.string().optional()
|
|
554
|
-
* })
|
|
555
|
-
* })
|
|
556
|
-
*
|
|
557
|
-
* // Different validation rules based on type
|
|
558
|
-
* v.object({
|
|
559
|
-
* contactType: v.string().in(['email', 'phone']),
|
|
560
|
-
* contact: v.string().when('contactType', {
|
|
561
|
-
* is: {
|
|
562
|
-
* email: v.string().email(),
|
|
563
|
-
* phone: v.string().pattern(/^\d{10}$/)
|
|
564
|
-
* }
|
|
565
|
-
* })
|
|
566
|
-
* })
|
|
567
|
-
* ```
|
|
568
|
-
* @category Conditional Validation
|
|
569
|
-
*/
|
|
570
|
-
when(field: string, options: Omit<WhenRuleOptions, "field" | "scope">): this;
|
|
571
|
-
/**
|
|
572
|
-
* Apply different validation rules based on sibling field's value
|
|
573
|
-
*
|
|
574
|
-
* Use this for nested objects where you need to check a field
|
|
575
|
-
* within the same parent object.
|
|
576
|
-
*
|
|
577
|
-
* @param siblingField - Sibling field name to check
|
|
578
|
-
* @param options - Validation options per field value
|
|
579
|
-
*
|
|
580
|
-
* @example
|
|
581
|
-
* ```ts
|
|
582
|
-
* // Array of users with role-based permissions
|
|
583
|
-
* v.array(v.object({
|
|
584
|
-
* userType: v.string().in(['admin', 'user']),
|
|
585
|
-
* permissions: v.string().whenSibling('userType', {
|
|
586
|
-
* is: {
|
|
587
|
-
* admin: v.string().in(['read', 'write', 'delete']),
|
|
588
|
-
* user: v.string().in(['read'])
|
|
589
|
-
* }
|
|
590
|
-
* })
|
|
591
|
-
* }))
|
|
592
|
-
* ```
|
|
593
|
-
* @category Conditional Validation
|
|
594
|
-
*/
|
|
595
|
-
whenSibling(siblingField: string, options: Omit<WhenRuleOptions, "field" | "scope">): this;
|
|
596
|
-
/**
|
|
597
|
-
* Set the label for the validator that will be matching the :input attribute
|
|
598
|
-
*/
|
|
599
|
-
label(label: string): this;
|
|
600
|
-
/**
|
|
601
|
-
* Validate the data
|
|
602
|
-
*/
|
|
603
|
-
validate(data: any, context: SchemaContext): Promise<ValidationResult>;
|
|
604
|
-
/**
|
|
605
|
-
* Set rule attributes list
|
|
606
|
-
*/
|
|
607
|
-
protected setRuleAttributesList(rule: ContextualSchemaRule): void;
|
|
608
|
-
}
|
|
609
|
-
//# sourceMappingURL=base-validator.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-validator.d.ts","sourceRoot":"","sources":["../../src/validators/base-validator.ts"],"names":[],"mappings":"AA0CA,OAAO,KAAK,EACV,oBAAoB,EACpB,qBAAqB,EACrB,yBAAyB,EACzB,OAAO,EACP,aAAa,EACb,UAAU,EACV,iBAAiB,EACjB,yBAAyB,EACzB,mBAAmB,EACnB,wBAAwB,EACxB,gBAAgB,EAChB,eAAe,EAChB,MAAM,UAAU,CAAC;AAElB;;GAEG;AACH,qBAAa,aAAa;IACjB,KAAK,EAAE,oBAAoB,EAAE,CAAM;IACnC,QAAQ,EAAE,qBAAqB,EAAE,CAAM;IAC9C,SAAS,CAAC,YAAY,EAAE,GAAG,CAAC;IAC5B,SAAS,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC/B,SAAS,CAAC,UAAU,UAAS;IAC7B,SAAS,CAAC,UAAU,UAA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