@oxog/vld 2.0.3 → 2.2.5
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/CHANGELOG.md +120 -1
- package/README.md +1296 -1171
- package/dist/chunks/errors-core-Cqi4-9ew.js +1 -0
- package/dist/chunks/index-CkbfQQ4n.js +1 -0
- package/dist/chunks/index-yjpbvFgw.js +1 -0
- package/dist/chunks/ip-validation-g5LWgy9t.js +1 -0
- package/dist/chunks/security-Dy24T8N7.js +1 -0
- package/dist/cjs/chunks/errors-core-DKPohm9I.cjs +1 -0
- package/dist/cjs/chunks/index-BEV9nG0N.cjs +1 -0
- package/dist/cjs/chunks/index-ZjHAxYdA.cjs +1 -0
- package/dist/cjs/chunks/ip-validation-BZqPamPC.cjs +1 -0
- package/dist/cjs/chunks/security-aXZVI7qW.cjs +1 -0
- package/dist/cjs/cli/bin.cjs +2 -0
- package/dist/cjs/cli/index.cjs +1 -0
- package/dist/cjs/codecs/index.cjs +1 -0
- package/dist/cjs/coercion/index.cjs +1 -0
- package/dist/cjs/compat/emitter.cjs +1 -0
- package/dist/cjs/compat/result.cjs +1 -0
- package/dist/cjs/errors.cjs +1 -387
- package/dist/cjs/index.cjs +1 -10759
- package/dist/cjs/kernel.cjs +1 -0
- package/dist/cjs/locales/af.cjs +1 -0
- package/dist/cjs/locales/ar.cjs +1 -0
- package/dist/cjs/locales/bn.cjs +1 -0
- package/dist/cjs/locales/da.cjs +1 -0
- package/dist/cjs/locales/de.cjs +1 -0
- package/dist/cjs/locales/en.cjs +1 -0
- package/dist/cjs/locales/es-MX.cjs +1 -0
- package/dist/cjs/locales/es.cjs +1 -0
- package/dist/cjs/locales/fi.cjs +1 -0
- package/dist/cjs/locales/fr.cjs +1 -0
- package/dist/cjs/locales/hi.cjs +1 -0
- package/dist/cjs/locales/id.cjs +1 -0
- package/dist/cjs/locales/index.cjs +1 -2877
- package/dist/cjs/locales/it.cjs +1 -0
- package/dist/cjs/locales/ja.cjs +1 -0
- package/dist/cjs/locales/ko.cjs +1 -0
- package/dist/cjs/locales/lazy.cjs +1 -3169
- package/dist/cjs/locales/nl.cjs +1 -0
- package/dist/cjs/locales/no.cjs +1 -0
- package/dist/cjs/locales/pl.cjs +1 -0
- package/dist/cjs/locales/pt-BR.cjs +1 -0
- package/dist/cjs/locales/pt.cjs +1 -0
- package/dist/cjs/locales/ru.cjs +1 -0
- package/dist/cjs/locales/runtime.cjs +1 -0
- package/dist/cjs/locales/sv.cjs +1 -0
- package/dist/cjs/locales/sw.cjs +1 -0
- package/dist/cjs/locales/th.cjs +1 -0
- package/dist/cjs/locales/tr.cjs +1 -0
- package/dist/cjs/locales/vi.cjs +1 -0
- package/dist/cjs/locales/zh.cjs +1 -0
- package/dist/cjs/mini.cjs +1 -7474
- package/dist/cjs/pigment.cjs +1 -0
- package/dist/cjs/plugins/index.cjs +1 -0
- package/dist/cjs/registry.cjs +1 -0
- package/dist/cjs/v3/index.cjs +1 -0
- package/dist/cjs/v4/core/index.cjs +1 -0
- package/dist/cjs/v4/index.cjs +1 -0
- package/dist/cjs/v4/locales/index.cjs +1 -0
- package/dist/cjs/v4/mini/index.cjs +1 -0
- package/dist/cjs/v4-mini/index.cjs +1 -0
- package/dist/cjs/validators/any.cjs +1 -0
- package/dist/cjs/validators/array.cjs +1 -0
- package/dist/cjs/validators/base.cjs +1 -0
- package/dist/cjs/validators/base64.cjs +1 -0
- package/dist/cjs/validators/bigint.cjs +1 -0
- package/dist/cjs/validators/boolean.cjs +1 -0
- package/dist/cjs/validators/codec.cjs +1 -0
- package/dist/cjs/validators/custom.cjs +1 -0
- package/dist/cjs/validators/date.cjs +1 -0
- package/dist/cjs/validators/discriminated-union.cjs +1 -0
- package/dist/cjs/validators/enum.cjs +1 -0
- package/dist/cjs/validators/file.cjs +1 -0
- package/dist/cjs/validators/function.cjs +1 -0
- package/dist/cjs/validators/hex.cjs +1 -0
- package/dist/cjs/validators/index.cjs +1 -0
- package/dist/cjs/validators/intersection.cjs +1 -0
- package/dist/cjs/validators/json.cjs +1 -0
- package/dist/cjs/validators/lazy.cjs +1 -0
- package/dist/cjs/validators/literal.cjs +1 -0
- package/dist/cjs/validators/map.cjs +1 -0
- package/dist/cjs/validators/nan.cjs +1 -0
- package/dist/cjs/validators/never.cjs +1 -0
- package/dist/cjs/validators/null.cjs +1 -0
- package/dist/cjs/validators/number.cjs +1 -0
- package/dist/cjs/validators/object.cjs +1 -0
- package/dist/cjs/validators/promise.cjs +1 -0
- package/dist/cjs/validators/record.cjs +1 -0
- package/dist/cjs/validators/set.cjs +1 -0
- package/dist/cjs/validators/string-bool.cjs +1 -0
- package/dist/cjs/validators/string-formats.cjs +1 -0
- package/dist/cjs/validators/string.cjs +1 -0
- package/dist/cjs/validators/symbol.cjs +1 -0
- package/dist/cjs/validators/template-literal.cjs +1 -0
- package/dist/cjs/validators/tuple.cjs +1 -0
- package/dist/cjs/validators/uint8array.cjs +1 -0
- package/dist/cjs/validators/undefined.cjs +1 -0
- package/dist/cjs/validators/union.cjs +1 -0
- package/dist/cjs/validators/unknown.cjs +1 -0
- package/dist/cjs/validators/void.cjs +1 -0
- package/dist/cjs/validators/xor.cjs +1 -0
- package/dist/cli/bin.d.ts +0 -1
- package/dist/cli/bin.js +2 -0
- package/dist/cli/commands/benchmark.d.ts +1 -2
- package/dist/cli/commands/validate.d.ts +1 -2
- package/dist/cli/index.d.ts +0 -1
- package/dist/cli/index.js +1 -0
- package/dist/codecs/index.d.ts +21 -4
- package/dist/codecs/index.js +1 -4
- package/dist/coercion/bigint.d.ts +2 -3
- package/dist/coercion/boolean.d.ts +3 -3
- package/dist/coercion/date.d.ts +3 -3
- package/dist/coercion/index.d.ts +5 -6
- package/dist/coercion/index.js +1 -111
- package/dist/coercion/number.d.ts +2 -3
- package/dist/coercion/string.d.ts +2 -3
- package/dist/compat/emitter.d.ts +0 -1
- package/dist/compat/emitter.js +1 -181
- package/dist/compat/index.d.ts +4 -5
- package/dist/compat/result.d.ts +1 -2
- package/dist/compat/result.js +1 -171
- package/dist/errors-core.d.ts +58 -0
- package/dist/errors.d.ts +4 -54
- package/dist/errors.js +1 -235
- package/dist/events.d.ts +3 -4
- package/dist/index.d.ts +1093 -851
- package/dist/index.js +1 -855
- package/dist/kernel.d.ts +2 -3
- package/dist/kernel.js +1 -405
- package/dist/locales/af.d.ts +1 -2
- package/dist/locales/af.js +1 -107
- package/dist/locales/ar.d.ts +1 -2
- package/dist/locales/ar.js +1 -107
- package/dist/locales/bn.d.ts +1 -2
- package/dist/locales/bn.js +1 -107
- package/dist/locales/da.d.ts +1 -2
- package/dist/locales/da.js +1 -107
- package/dist/locales/de.d.ts +1 -2
- package/dist/locales/de.js +1 -107
- package/dist/locales/en.d.ts +1 -2
- package/dist/locales/en.js +1 -107
- package/dist/locales/es-MX.d.ts +1 -2
- package/dist/locales/es-MX.js +1 -106
- package/dist/locales/es.d.ts +1 -2
- package/dist/locales/es.js +1 -95
- package/dist/locales/fi.d.ts +1 -2
- package/dist/locales/fi.js +1 -107
- package/dist/locales/fr.d.ts +1 -2
- package/dist/locales/fr.js +1 -95
- package/dist/locales/hi.d.ts +1 -2
- package/dist/locales/hi.js +1 -107
- package/dist/locales/id.d.ts +1 -2
- package/dist/locales/id.js +1 -107
- package/dist/locales/index.d.ts +10 -15
- package/dist/locales/index.js +1 -3
- package/dist/locales/it.d.ts +1 -2
- package/dist/locales/it.js +1 -107
- package/dist/locales/ja.d.ts +1 -2
- package/dist/locales/ja.js +1 -107
- package/dist/locales/ko.d.ts +1 -2
- package/dist/locales/ko.js +1 -107
- package/dist/locales/lazy.d.ts +4 -26
- package/dist/locales/lazy.js +1 -220
- package/dist/locales/nl.d.ts +1 -2
- package/dist/locales/nl.js +1 -107
- package/dist/locales/no.d.ts +1 -2
- package/dist/locales/no.js +1 -107
- package/dist/locales/pl.d.ts +1 -2
- package/dist/locales/pl.js +1 -107
- package/dist/locales/pt-BR.d.ts +1 -2
- package/dist/locales/pt-BR.js +1 -107
- package/dist/locales/pt.d.ts +1 -2
- package/dist/locales/pt.js +1 -107
- package/dist/locales/ru.d.ts +1 -2
- package/dist/locales/ru.js +1 -107
- package/dist/locales/runtime.d.ts +10 -0
- package/dist/locales/runtime.js +1 -0
- package/dist/locales/sv.d.ts +1 -2
- package/dist/locales/sv.js +1 -107
- package/dist/locales/sw.d.ts +1 -2
- package/dist/locales/sw.js +1 -107
- package/dist/locales/th.d.ts +1 -2
- package/dist/locales/th.js +1 -107
- package/dist/locales/tr.d.ts +1 -2
- package/dist/locales/tr.js +1 -107
- package/dist/locales/types.d.ts +0 -1
- package/dist/locales/vi.d.ts +1 -2
- package/dist/locales/vi.js +1 -107
- package/dist/locales/zh.d.ts +1 -2
- package/dist/locales/zh.js +1 -107
- package/dist/logger.d.ts +0 -1
- package/dist/mini.d.ts +67 -68
- package/dist/mini.js +1 -132
- package/dist/pigment.d.ts +0 -1
- package/dist/pigment.js +1 -178
- package/dist/plugins/index.d.ts +2 -3
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/types.d.ts +4 -5
- package/dist/registry.d.ts +23 -0
- package/dist/registry.js +1 -0
- package/dist/utils/codec-utils.d.ts +0 -1
- package/dist/utils/deep-merge.d.ts +0 -1
- package/dist/utils/ip-validation.d.ts +0 -1
- package/dist/utils/json-schema.d.ts +26 -7
- package/dist/utils/security.d.ts +2 -6
- package/dist/v3/index.d.ts +2 -0
- package/dist/v3/index.js +1 -0
- package/dist/v4/core/index.d.ts +272 -0
- package/dist/v4/core/index.js +1 -0
- package/dist/v4/index.d.ts +4 -0
- package/dist/v4/index.js +1 -0
- package/dist/v4/locales/index.d.ts +57 -0
- package/dist/v4/locales/index.js +1 -0
- package/dist/v4/mini/index.d.ts +2 -0
- package/dist/v4/mini/index.js +1 -0
- package/dist/v4-mini/index.d.ts +22 -0
- package/dist/v4-mini/index.js +1 -0
- package/dist/validators/any.d.ts +7 -2
- package/dist/validators/any.js +1 -0
- package/dist/validators/array.d.ts +16 -2
- package/dist/validators/array.js +1 -0
- package/dist/validators/base.d.ts +213 -14
- package/dist/validators/base.js +1 -0
- package/dist/validators/base64.d.ts +1 -2
- package/dist/validators/base64.js +1 -0
- package/dist/validators/bigint.d.ts +21 -3
- package/dist/validators/bigint.js +1 -0
- package/dist/validators/boolean.d.ts +13 -4
- package/dist/validators/boolean.js +1 -0
- package/dist/validators/codec.d.ts +9 -2
- package/dist/validators/codec.js +1 -0
- package/dist/validators/custom.d.ts +15 -2
- package/dist/validators/custom.js +1 -0
- package/dist/validators/date.d.ts +19 -3
- package/dist/validators/date.js +1 -0
- package/dist/validators/discriminated-union.d.ts +6 -5
- package/dist/validators/discriminated-union.js +1 -0
- package/dist/validators/enum.d.ts +10 -7
- package/dist/validators/enum.js +1 -0
- package/dist/validators/file.d.ts +7 -2
- package/dist/validators/file.js +1 -0
- package/dist/validators/function.d.ts +11 -5
- package/dist/validators/function.js +1 -0
- package/dist/validators/hex.d.ts +1 -2
- package/dist/validators/hex.js +1 -0
- package/dist/validators/index.d.ts +38 -39
- package/dist/validators/index.js +1 -515
- package/dist/validators/intersection.d.ts +1 -2
- package/dist/validators/intersection.js +1 -0
- package/dist/validators/json.d.ts +1 -2
- package/dist/validators/json.js +1 -0
- package/dist/validators/lazy.d.ts +5 -9
- package/dist/validators/lazy.js +1 -0
- package/dist/validators/literal.d.ts +9 -5
- package/dist/validators/literal.js +1 -0
- package/dist/validators/map.d.ts +15 -2
- package/dist/validators/map.js +1 -0
- package/dist/validators/nan.d.ts +2 -3
- package/dist/validators/nan.js +1 -0
- package/dist/validators/never.d.ts +1 -2
- package/dist/validators/never.js +1 -0
- package/dist/validators/null.d.ts +3 -3
- package/dist/validators/null.js +1 -0
- package/dist/validators/number.d.ts +75 -27
- package/dist/validators/number.js +1 -0
- package/dist/validators/object.d.ts +42 -11
- package/dist/validators/object.js +1 -0
- package/dist/validators/promise.d.ts +15 -10
- package/dist/validators/promise.js +1 -0
- package/dist/validators/record.d.ts +21 -9
- package/dist/validators/record.js +1 -0
- package/dist/validators/set.d.ts +11 -2
- package/dist/validators/set.js +1 -0
- package/dist/validators/string-bool.d.ts +7 -10
- package/dist/validators/string-bool.js +1 -0
- package/dist/validators/string-formats.d.ts +64 -65
- package/dist/validators/string-formats.js +1 -0
- package/dist/validators/string.d.ts +84 -26
- package/dist/validators/string.js +1 -0
- package/dist/validators/symbol.d.ts +8 -3
- package/dist/validators/symbol.js +1 -0
- package/dist/validators/template-literal.d.ts +1 -2
- package/dist/validators/template-literal.js +1 -0
- package/dist/validators/tuple.d.ts +29 -12
- package/dist/validators/tuple.js +1 -0
- package/dist/validators/uint8array.d.ts +3 -4
- package/dist/validators/uint8array.js +1 -0
- package/dist/validators/undefined.d.ts +3 -3
- package/dist/validators/undefined.js +1 -0
- package/dist/validators/union.d.ts +7 -4
- package/dist/validators/union.js +1 -0
- package/dist/validators/unknown.d.ts +7 -2
- package/dist/validators/unknown.js +1 -0
- package/dist/validators/void.d.ts +3 -2
- package/dist/validators/void.js +1 -0
- package/dist/validators/xor.d.ts +4 -5
- package/dist/validators/xor.js +1 -0
- package/package.json +239 -154
- package/dist/chunks/bigint-CRS0QVsy.js +0 -1854
- package/dist/chunks/bigint-CRS0QVsy.js.map +0 -1
- package/dist/chunks/date-50JV_Mfj.js +0 -506
- package/dist/chunks/date-50JV_Mfj.js.map +0 -1
- package/dist/chunks/index-DO8CFMxD.js +0 -894
- package/dist/chunks/index-DO8CFMxD.js.map +0 -1
- package/dist/chunks/json-Cp4WO0M9.js +0 -2021
- package/dist/chunks/json-Cp4WO0M9.js.map +0 -1
- package/dist/chunks/unknown-Dhzri_T-.js +0 -28
- package/dist/chunks/unknown-Dhzri_T-.js.map +0 -1
- package/dist/cjs/errors.cjs.map +0 -1
- package/dist/cjs/index.cjs.map +0 -1
- package/dist/cjs/locales/index.cjs.map +0 -1
- package/dist/cjs/locales/lazy.cjs.map +0 -1
- package/dist/cjs/mini.cjs.map +0 -1
- package/dist/cli/bin.d.ts.map +0 -1
- package/dist/cli/commands/benchmark.d.ts.map +0 -1
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/codecs/index.d.ts.map +0 -1
- package/dist/codecs/index.js.map +0 -1
- package/dist/coercion/bigint.d.ts.map +0 -1
- package/dist/coercion/boolean.d.ts.map +0 -1
- package/dist/coercion/date.d.ts.map +0 -1
- package/dist/coercion/index.d.ts.map +0 -1
- package/dist/coercion/index.js.map +0 -1
- package/dist/coercion/number.d.ts.map +0 -1
- package/dist/coercion/string.d.ts.map +0 -1
- package/dist/compat/emitter.d.ts.map +0 -1
- package/dist/compat/emitter.js.map +0 -1
- package/dist/compat/index.d.ts.map +0 -1
- package/dist/compat/result.d.ts.map +0 -1
- package/dist/compat/result.js.map +0 -1
- package/dist/errors.d.ts.map +0 -1
- package/dist/errors.js.map +0 -1
- package/dist/events.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/kernel.d.ts.map +0 -1
- package/dist/kernel.js.map +0 -1
- package/dist/locales/af.d.ts.map +0 -1
- package/dist/locales/af.js.map +0 -1
- package/dist/locales/ar.d.ts.map +0 -1
- package/dist/locales/ar.js.map +0 -1
- package/dist/locales/backup-en.d.ts +0 -3
- package/dist/locales/backup-en.d.ts.map +0 -1
- package/dist/locales/bn.d.ts.map +0 -1
- package/dist/locales/bn.js.map +0 -1
- package/dist/locales/da.d.ts.map +0 -1
- package/dist/locales/da.js.map +0 -1
- package/dist/locales/de.d.ts.map +0 -1
- package/dist/locales/de.js.map +0 -1
- package/dist/locales/en.d.ts.map +0 -1
- package/dist/locales/en.js.map +0 -1
- package/dist/locales/es-MX.d.ts.map +0 -1
- package/dist/locales/es-MX.js.map +0 -1
- package/dist/locales/es.d.ts.map +0 -1
- package/dist/locales/es.js.map +0 -1
- package/dist/locales/fi.d.ts.map +0 -1
- package/dist/locales/fi.js.map +0 -1
- package/dist/locales/fr.d.ts.map +0 -1
- package/dist/locales/fr.js.map +0 -1
- package/dist/locales/hi.d.ts.map +0 -1
- package/dist/locales/hi.js.map +0 -1
- package/dist/locales/id.d.ts.map +0 -1
- package/dist/locales/id.js.map +0 -1
- package/dist/locales/index.d.ts.map +0 -1
- package/dist/locales/index.js.map +0 -1
- package/dist/locales/it.d.ts.map +0 -1
- package/dist/locales/it.js.map +0 -1
- package/dist/locales/ja.d.ts.map +0 -1
- package/dist/locales/ja.js.map +0 -1
- package/dist/locales/ko.d.ts.map +0 -1
- package/dist/locales/ko.js.map +0 -1
- package/dist/locales/lazy.d.ts.map +0 -1
- package/dist/locales/lazy.js.map +0 -1
- package/dist/locales/nl.d.ts.map +0 -1
- package/dist/locales/nl.js.map +0 -1
- package/dist/locales/no.d.ts.map +0 -1
- package/dist/locales/no.js.map +0 -1
- package/dist/locales/pl.d.ts.map +0 -1
- package/dist/locales/pl.js.map +0 -1
- package/dist/locales/pt-BR.d.ts.map +0 -1
- package/dist/locales/pt-BR.js.map +0 -1
- package/dist/locales/pt.d.ts.map +0 -1
- package/dist/locales/pt.js.map +0 -1
- package/dist/locales/ru.d.ts.map +0 -1
- package/dist/locales/ru.js.map +0 -1
- package/dist/locales/sv.d.ts.map +0 -1
- package/dist/locales/sv.js.map +0 -1
- package/dist/locales/sw.d.ts.map +0 -1
- package/dist/locales/sw.js.map +0 -1
- package/dist/locales/th.d.ts.map +0 -1
- package/dist/locales/th.js.map +0 -1
- package/dist/locales/tr.d.ts.map +0 -1
- package/dist/locales/tr.js.map +0 -1
- package/dist/locales/types.d.ts.map +0 -1
- package/dist/locales/vi.d.ts.map +0 -1
- package/dist/locales/vi.js.map +0 -1
- package/dist/locales/zh.d.ts.map +0 -1
- package/dist/locales/zh.js.map +0 -1
- package/dist/logger.d.ts.map +0 -1
- package/dist/mini.d.ts.map +0 -1
- package/dist/mini.js.map +0 -1
- package/dist/pigment.d.ts.map +0 -1
- package/dist/pigment.js.map +0 -1
- package/dist/plugins/index.d.ts.map +0 -1
- package/dist/plugins/types.d.ts.map +0 -1
- package/dist/utils/codec-utils.d.ts.map +0 -1
- package/dist/utils/deep-merge.d.ts.map +0 -1
- package/dist/utils/ip-validation.d.ts.map +0 -1
- package/dist/utils/json-schema.d.ts.map +0 -1
- package/dist/utils/security.d.ts.map +0 -1
- package/dist/validators/any.d.ts.map +0 -1
- package/dist/validators/array.d.ts.map +0 -1
- package/dist/validators/base.d.ts.map +0 -1
- package/dist/validators/base64.d.ts.map +0 -1
- package/dist/validators/bigint.d.ts.map +0 -1
- package/dist/validators/boolean.d.ts.map +0 -1
- package/dist/validators/codec.d.ts.map +0 -1
- package/dist/validators/custom.d.ts.map +0 -1
- package/dist/validators/date.d.ts.map +0 -1
- package/dist/validators/discriminated-union.d.ts.map +0 -1
- package/dist/validators/enum.d.ts.map +0 -1
- package/dist/validators/file.d.ts.map +0 -1
- package/dist/validators/function.d.ts.map +0 -1
- package/dist/validators/hex.d.ts.map +0 -1
- package/dist/validators/index.d.ts.map +0 -1
- package/dist/validators/index.js.map +0 -1
- package/dist/validators/intersection.d.ts.map +0 -1
- package/dist/validators/json.d.ts.map +0 -1
- package/dist/validators/lazy.d.ts.map +0 -1
- package/dist/validators/literal.d.ts.map +0 -1
- package/dist/validators/map.d.ts.map +0 -1
- package/dist/validators/nan.d.ts.map +0 -1
- package/dist/validators/never.d.ts.map +0 -1
- package/dist/validators/null.d.ts.map +0 -1
- package/dist/validators/number.d.ts.map +0 -1
- package/dist/validators/object.d.ts.map +0 -1
- package/dist/validators/promise.d.ts.map +0 -1
- package/dist/validators/record.d.ts.map +0 -1
- package/dist/validators/set.d.ts.map +0 -1
- package/dist/validators/string-bool.d.ts.map +0 -1
- package/dist/validators/string-formats.d.ts.map +0 -1
- package/dist/validators/string.d.ts.map +0 -1
- package/dist/validators/symbol.d.ts.map +0 -1
- package/dist/validators/template-literal.d.ts.map +0 -1
- package/dist/validators/tuple.d.ts.map +0 -1
- package/dist/validators/uint8array.d.ts.map +0 -1
- package/dist/validators/undefined.d.ts.map +0 -1
- package/dist/validators/union.d.ts.map +0 -1
- package/dist/validators/unknown.d.ts.map +0 -1
- package/dist/validators/void.d.ts.map +0 -1
- package/dist/validators/xor.d.ts.map +0 -1
package/dist/mini.js
CHANGED
|
@@ -1,132 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { i as VldBase, j as VldBrand, k as VldCatch, l as VldDefault, m as VldPipe, n as VldReadonly, o as VldRefine, p as VldSuperRefine, q as VldTransform } from './chunks/bigint-CRS0QVsy.js';
|
|
3
|
-
import { V as VldNever, a as VldAny, b as VldArray, c as VldDiscriminatedUnion, d as VldEnum, e as VldIntersection, f as VldJson, g as VldLazy, h as VldLiteral, i as VldObject, j as VldRecord, k as VldMap, l as VldNan, m as VldNull, n as VldSet, o as VldStringBool, p as VldSymbol, q as VldTuple, r as VldUndefined, s as VldUnion, t as VldVoid, u as VldXor } from './chunks/json-Cp4WO0M9.js';
|
|
4
|
-
import { V as VldUnknown } from './chunks/unknown-Dhzri_T-.js';
|
|
5
|
-
import { V as VldCoerceDate, a as VldCoerceBoolean, b as VldCoerceNumber, c as VldCoerceString } from './chunks/date-50JV_Mfj.js';
|
|
6
|
-
import { VldCoerceBigInt } from './coercion/index.js';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* VLD Mini - Tree-Shakable Functional API
|
|
10
|
-
*
|
|
11
|
-
* This module provides a functional, tree-shakable alternative to the main `v` object.
|
|
12
|
-
* Use this when bundle size is critical.
|
|
13
|
-
*
|
|
14
|
-
* @example
|
|
15
|
-
* ```typescript
|
|
16
|
-
* import { string, number, object, optional } from '@oxog/vld/mini';
|
|
17
|
-
*
|
|
18
|
-
* const schema = object({
|
|
19
|
-
* name: string().min(1),
|
|
20
|
-
* age: optional(number().int())
|
|
21
|
-
* });
|
|
22
|
-
* ```
|
|
23
|
-
*/
|
|
24
|
-
// ============================================
|
|
25
|
-
// Base Types & Classes
|
|
26
|
-
// ============================================
|
|
27
|
-
// --- Primitive Validators ---
|
|
28
|
-
/** Create a string validator */
|
|
29
|
-
const string = () => VldString.create();
|
|
30
|
-
/** Create a number validator */
|
|
31
|
-
const number = () => VldNumber.create();
|
|
32
|
-
/** Create an integer validator */
|
|
33
|
-
const int = () => VldNumber.create().int();
|
|
34
|
-
/** Create an int32 validator (-2147483648 to 2147483647) */
|
|
35
|
-
const int32 = () => VldNumber.create().int().min(-2147483648).max(2147483647);
|
|
36
|
-
/** Create a boolean validator */
|
|
37
|
-
const boolean = () => VldBoolean.create();
|
|
38
|
-
/** Create a date validator */
|
|
39
|
-
const date = () => VldDate.create();
|
|
40
|
-
/** Create a bigint validator */
|
|
41
|
-
const bigint = () => VldBigInt.create();
|
|
42
|
-
/** Create a symbol validator */
|
|
43
|
-
const symbol = () => VldSymbol.create();
|
|
44
|
-
/** Create a string-to-boolean validator */
|
|
45
|
-
const stringbool = (options) => VldStringBool.create(options);
|
|
46
|
-
// --- Complex Validators ---
|
|
47
|
-
/** Create an array validator */
|
|
48
|
-
const array = (item) => VldArray.create(item);
|
|
49
|
-
/** Create an object validator */
|
|
50
|
-
const object = (shape) => VldObject.create(shape);
|
|
51
|
-
/** Create a strict object validator (no extra keys allowed) */
|
|
52
|
-
const strictObject = (shape) => VldObject.create(shape).strict();
|
|
53
|
-
/** Create a loose object validator (extra keys passed through) */
|
|
54
|
-
const looseObject = (shape) => VldObject.create(shape).passthrough();
|
|
55
|
-
/** Create a tuple validator */
|
|
56
|
-
const tuple = (...items) => VldTuple.create(...items);
|
|
57
|
-
/** Create a record validator */
|
|
58
|
-
const record = (value) => VldRecord.create(value);
|
|
59
|
-
/** Create a partial record validator */
|
|
60
|
-
const partialRecord = (value) => VldRecord.create(value).partial();
|
|
61
|
-
/** Create a loose record validator */
|
|
62
|
-
const looseRecord = (value) => VldRecord.create(value).loose();
|
|
63
|
-
/** Create a set validator */
|
|
64
|
-
const set = (item) => VldSet.create(item);
|
|
65
|
-
/** Create a map validator */
|
|
66
|
-
const map = (key, value) => VldMap.create(key, value);
|
|
67
|
-
// --- Union & Intersection ---
|
|
68
|
-
/** Create a union validator (value must match one of the validators) */
|
|
69
|
-
const union = (...validators) => VldUnion.create(...validators);
|
|
70
|
-
/** Create an intersection validator (value must match both validators) */
|
|
71
|
-
const intersection = (first, second) => VldIntersection.create(first, second);
|
|
72
|
-
/** Create a discriminated union validator */
|
|
73
|
-
const discriminatedUnion = (discriminator, ...options) => VldDiscriminatedUnion.create(discriminator, [...options]);
|
|
74
|
-
/** Create an XOR validator (value must match exactly one of the validators) */
|
|
75
|
-
const xor = (...options) => VldXor.create([...options]);
|
|
76
|
-
// --- Literal & Enum ---
|
|
77
|
-
/** Create a literal validator */
|
|
78
|
-
const literal = (value) => VldLiteral.create(value);
|
|
79
|
-
/** Create an enum validator */
|
|
80
|
-
const enumValidator = (...values) => VldEnum.create(values);
|
|
81
|
-
// --- Special Validators ---
|
|
82
|
-
/** Create a validator that accepts any value */
|
|
83
|
-
const any = () => VldAny.create();
|
|
84
|
-
/** Create a validator that accepts unknown values */
|
|
85
|
-
const unknown = () => VldUnknown.create();
|
|
86
|
-
/** Create a void validator */
|
|
87
|
-
const voidValidator = () => VldVoid.create();
|
|
88
|
-
/** Create a never validator (always fails) */
|
|
89
|
-
const never = () => VldNever.create();
|
|
90
|
-
/** Create a null validator */
|
|
91
|
-
const nullValidator = () => VldNull.create();
|
|
92
|
-
/** Create an undefined validator */
|
|
93
|
-
const undefinedValidator = () => VldUndefined.create();
|
|
94
|
-
/** Create a NaN validator */
|
|
95
|
-
const nan = () => VldNan.create();
|
|
96
|
-
// --- Utility Validators ---
|
|
97
|
-
/** Create a lazy validator for recursive schemas */
|
|
98
|
-
const lazy = (schemaGetter) => VldLazy.create(schemaGetter);
|
|
99
|
-
/** Create a JSON validator */
|
|
100
|
-
const json = (schema) => VldJson.create(schema);
|
|
101
|
-
// ============================================
|
|
102
|
-
// Utility Functions (Wrappers)
|
|
103
|
-
// ============================================
|
|
104
|
-
/** Make a validator optional (allows undefined) */
|
|
105
|
-
const optional = (validator) => VldOptional.create(validator);
|
|
106
|
-
/** Make a validator nullable (allows null) */
|
|
107
|
-
const nullable = (validator) => VldNullable.create(validator);
|
|
108
|
-
/** Make a validator nullish (allows null or undefined) */
|
|
109
|
-
const nullish = (validator) => VldNullish.create(validator);
|
|
110
|
-
/** Preprocess input before validation */
|
|
111
|
-
const preprocess = (preprocessor, schema) => VldPreprocess.create(preprocessor, schema);
|
|
112
|
-
/** Coercion validators - convert values to target type before validation */
|
|
113
|
-
const coerce = {
|
|
114
|
-
/** Coerce to string */
|
|
115
|
-
string: () => VldCoerceString.create(),
|
|
116
|
-
/** Coerce to number */
|
|
117
|
-
number: () => VldCoerceNumber.create(),
|
|
118
|
-
/** Coerce to boolean */
|
|
119
|
-
boolean: () => VldCoerceBoolean.create(),
|
|
120
|
-
/** Coerce to date */
|
|
121
|
-
date: () => VldCoerceDate.create(),
|
|
122
|
-
/** Coerce to bigint */
|
|
123
|
-
bigint: () => VldCoerceBigInt.create(),
|
|
124
|
-
};
|
|
125
|
-
// ============================================
|
|
126
|
-
// NEVER Constant (for transforms)
|
|
127
|
-
// ============================================
|
|
128
|
-
/** NEVER constant for use in transforms - Zod 4 API parity */
|
|
129
|
-
const NEVER = VldNever.create();
|
|
130
|
-
|
|
131
|
-
export { NEVER, VldAny, VldArray, VldBigInt, VldBoolean, VldDate, VldDiscriminatedUnion, VldEnum, VldIntersection, VldJson, VldLazy, VldLiteral, VldMap, VldNan, VldNever, VldNull, VldNullable, VldNullish, VldNumber, VldObject, VldOptional, VldPreprocess, VldRecord, VldSet, VldString, VldStringBool, VldSymbol, VldTuple, VldUndefined, VldUnion, VldUnknown, VldVoid, VldXor, any, array, bigint, boolean, coerce, date, discriminatedUnion, enumValidator, int, int32, intersection, json, lazy, literal, looseObject, looseRecord, map, nan, never, nullValidator, nullable, nullish, number, object, optional, partialRecord, preprocess, record, set, strictObject, string, stringbool, symbol, tuple, undefinedValidator, union, unknown, voidValidator, xor };
|
|
132
|
-
//# sourceMappingURL=mini.js.map
|
|
1
|
+
import{VldNullable as r,VldNullish as t,VldOptional as a,VldPreprocess as e}from"./validators/base.js";export{VldBase,VldBrand,VldCatch,VldDefault,VldPipe,VldReadonly,VldRefine,VldSuperRefine,VldTransform}from"./validators/base.js";import{VldString as o}from"./validators/string.js";import{VldNumber as i}from"./validators/number.js";import{VldBoolean as s}from"./validators/boolean.js";import{VldDate as m}from"./validators/date.js";import{VldBigInt as c}from"./validators/bigint.js";import{VldSymbol as l}from"./validators/symbol.js";import{VldStringBool as d}from"./validators/string-bool.js";import{VldArray as n}from"./validators/array.js";import{VldObject as p}from"./validators/object.js";import{VldTuple as f}from"./validators/tuple.js";import{VldRecord as j}from"./validators/record.js";import{VldSet as v}from"./validators/set.js";import{VldMap as u}from"./validators/map.js";import{VldUnion as b}from"./validators/union.js";import{VldIntersection as V}from"./validators/intersection.js";import{VldLiteral as g}from"./validators/literal.js";import{VldEnum as x}from"./validators/enum.js";import{VldAny as y}from"./validators/any.js";import{VldUnknown as h}from"./validators/unknown.js";import{VldVoid as R}from"./validators/void.js";import{VldNever as B}from"./validators/never.js";import{VldNull as k}from"./validators/null.js";import{VldUndefined as w}from"./validators/undefined.js";import{VldNan as z}from"./validators/nan.js";import{VldLazy as C}from"./validators/lazy.js";import{VldDiscriminatedUnion as D}from"./validators/discriminated-union.js";import{VldXor as P}from"./validators/xor.js";import{VldJson as S}from"./validators/json.js";import{VldCoerceBigInt as T,VldCoerceDate as q,VldCoerceBoolean as A,VldCoerceNumber as E,VldCoerceString as F}from"./coercion/index.js";const G=()=>o.create(),H=()=>i.create(),I=()=>i.create().int(),J=()=>i.create().int().min(-2147483648).max(2147483647),K=()=>s.create(),L=()=>m.create(),M=()=>c.create(),N=()=>l.create(),O=r=>d.create(r),Q=r=>n.create(r),U=r=>p.create(r),W=r=>p.create(r).strict(),X=r=>p.create(r).passthrough(),Y=(...r)=>f.create(...r),Z=r=>j.create(r),$=r=>j.create(r).partial(),_=r=>j.create(r).loose(),rr=r=>v.create(r),tr=(r,t)=>u.create(r,t),ar=(...r)=>b.create(...r),er=(r,t)=>V.create(r,t),or=(r,...t)=>D.create(r,[...t]),ir=(...r)=>P.create([...r]),sr=r=>g.create(r),mr=(...r)=>x.create(r),cr=()=>y.create(),lr=()=>h.create(),dr=()=>R.create(),nr=()=>B.create(),pr=()=>k.create(),fr=()=>w.create(),jr=()=>z.create(),vr=r=>C.create(r),ur=r=>S.create(r),br=r=>a.create(r),Vr=t=>r.create(t),gr=r=>t.create(r),xr=(r,t)=>e.create(r,t),yr={string:()=>F.create(),number:()=>E.create(),boolean:()=>A.create(),date:()=>q.create(),bigint:()=>T.create()},hr=B.create();export{hr as NEVER,y as VldAny,n as VldArray,c as VldBigInt,s as VldBoolean,m as VldDate,D as VldDiscriminatedUnion,x as VldEnum,V as VldIntersection,S as VldJson,C as VldLazy,g as VldLiteral,u as VldMap,z as VldNan,B as VldNever,k as VldNull,r as VldNullable,t as VldNullish,i as VldNumber,p as VldObject,a as VldOptional,e as VldPreprocess,j as VldRecord,v as VldSet,o as VldString,d as VldStringBool,l as VldSymbol,f as VldTuple,w as VldUndefined,b as VldUnion,h as VldUnknown,R as VldVoid,P as VldXor,cr as any,Q as array,M as bigint,K as boolean,yr as coerce,L as date,or as discriminatedUnion,mr as enumValidator,I as int,J as int32,er as intersection,ur as json,vr as lazy,sr as literal,X as looseObject,_ as looseRecord,tr as map,jr as nan,nr as never,pr as nullValidator,Vr as nullable,gr as nullish,H as number,U as object,br as optional,$ as partialRecord,xr as preprocess,Z as record,rr as set,W as strictObject,G as string,O as stringbool,N as symbol,Y as tuple,fr as undefinedValidator,ar as union,lr as unknown,dr as voidValidator,ir as xor};
|
package/dist/pigment.d.ts
CHANGED
package/dist/pigment.js
CHANGED
|
@@ -1,178 +1 @@
|
|
|
1
|
-
|
|
2
|
-
* VLD Pigment - Colored Console Output
|
|
3
|
-
*
|
|
4
|
-
* This module provides ANSI color utilities for terminal output,
|
|
5
|
-
* compatible with @oxog/pigment when available.
|
|
6
|
-
*/
|
|
7
|
-
/* eslint-enable @typescript-eslint/no-explicit-any */
|
|
8
|
-
/**
|
|
9
|
-
* Check if colors are supported in the current environment
|
|
10
|
-
*/
|
|
11
|
-
function supportsColor() {
|
|
12
|
-
// Check for NO_COLOR environment variable
|
|
13
|
-
if (typeof process !== 'undefined' && process.env?.NO_COLOR) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
// Check for FORCE_COLOR environment variable
|
|
17
|
-
if (typeof process !== 'undefined' && process.env?.FORCE_COLOR) {
|
|
18
|
-
return true;
|
|
19
|
-
}
|
|
20
|
-
// Check for TTY
|
|
21
|
-
if (typeof process !== 'undefined' && process.stdout?.isTTY) {
|
|
22
|
-
return true;
|
|
23
|
-
}
|
|
24
|
-
// Browser environment - no ANSI colors
|
|
25
|
-
if (typeof window !== 'undefined') {
|
|
26
|
-
return false;
|
|
27
|
-
}
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* ANSI escape codes
|
|
32
|
-
*/
|
|
33
|
-
const ANSI = {
|
|
34
|
-
// Reset
|
|
35
|
-
reset: '\x1b[0m',
|
|
36
|
-
// Styles
|
|
37
|
-
bold: '\x1b[1m',
|
|
38
|
-
dim: '\x1b[2m',
|
|
39
|
-
italic: '\x1b[3m',
|
|
40
|
-
underline: '\x1b[4m',
|
|
41
|
-
blink: '\x1b[5m',
|
|
42
|
-
inverse: '\x1b[7m',
|
|
43
|
-
hidden: '\x1b[8m',
|
|
44
|
-
strikethrough: '\x1b[9m',
|
|
45
|
-
// Foreground colors
|
|
46
|
-
black: '\x1b[30m',
|
|
47
|
-
red: '\x1b[31m',
|
|
48
|
-
green: '\x1b[32m',
|
|
49
|
-
yellow: '\x1b[33m',
|
|
50
|
-
blue: '\x1b[34m',
|
|
51
|
-
magenta: '\x1b[35m',
|
|
52
|
-
cyan: '\x1b[36m',
|
|
53
|
-
white: '\x1b[37m',
|
|
54
|
-
gray: '\x1b[90m',
|
|
55
|
-
grey: '\x1b[90m',
|
|
56
|
-
// Bright foreground colors
|
|
57
|
-
brightRed: '\x1b[91m',
|
|
58
|
-
brightGreen: '\x1b[92m',
|
|
59
|
-
brightYellow: '\x1b[93m',
|
|
60
|
-
brightBlue: '\x1b[94m',
|
|
61
|
-
brightMagenta: '\x1b[95m',
|
|
62
|
-
brightCyan: '\x1b[96m',
|
|
63
|
-
brightWhite: '\x1b[97m',
|
|
64
|
-
// Background colors
|
|
65
|
-
bgBlack: '\x1b[40m',
|
|
66
|
-
bgRed: '\x1b[41m',
|
|
67
|
-
bgGreen: '\x1b[42m',
|
|
68
|
-
bgYellow: '\x1b[43m',
|
|
69
|
-
bgBlue: '\x1b[44m',
|
|
70
|
-
bgMagenta: '\x1b[45m',
|
|
71
|
-
bgCyan: '\x1b[46m',
|
|
72
|
-
bgWhite: '\x1b[47m',
|
|
73
|
-
// Bright background colors
|
|
74
|
-
bgBrightRed: '\x1b[101m',
|
|
75
|
-
bgBrightGreen: '\x1b[102m',
|
|
76
|
-
bgBrightYellow: '\x1b[103m',
|
|
77
|
-
bgBrightBlue: '\x1b[104m',
|
|
78
|
-
bgBrightMagenta: '\x1b[105m',
|
|
79
|
-
bgBrightCyan: '\x1b[106m',
|
|
80
|
-
bgBrightWhite: '\x1b[107m'
|
|
81
|
-
};
|
|
82
|
-
/**
|
|
83
|
-
* Create a color function
|
|
84
|
-
*/
|
|
85
|
-
function createColorFn(code) {
|
|
86
|
-
const enabled = supportsColor();
|
|
87
|
-
return (text) => {
|
|
88
|
-
if (!enabled || text === '')
|
|
89
|
-
return text;
|
|
90
|
-
return `${code}${text}${ANSI.reset}`;
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
/**
|
|
94
|
-
* Pigment - Color utilities for terminal output
|
|
95
|
-
*/
|
|
96
|
-
const pigment = {
|
|
97
|
-
// Check support
|
|
98
|
-
supportsColor,
|
|
99
|
-
// Reset
|
|
100
|
-
reset: (text) => text,
|
|
101
|
-
// Styles
|
|
102
|
-
bold: createColorFn(ANSI.bold),
|
|
103
|
-
dim: createColorFn(ANSI.dim),
|
|
104
|
-
italic: createColorFn(ANSI.italic),
|
|
105
|
-
underline: createColorFn(ANSI.underline),
|
|
106
|
-
inverse: createColorFn(ANSI.inverse),
|
|
107
|
-
hidden: createColorFn(ANSI.hidden),
|
|
108
|
-
strikethrough: createColorFn(ANSI.strikethrough),
|
|
109
|
-
// Foreground colors
|
|
110
|
-
black: createColorFn(ANSI.black),
|
|
111
|
-
red: createColorFn(ANSI.red),
|
|
112
|
-
green: createColorFn(ANSI.green),
|
|
113
|
-
yellow: createColorFn(ANSI.yellow),
|
|
114
|
-
blue: createColorFn(ANSI.blue),
|
|
115
|
-
magenta: createColorFn(ANSI.magenta),
|
|
116
|
-
cyan: createColorFn(ANSI.cyan),
|
|
117
|
-
white: createColorFn(ANSI.white),
|
|
118
|
-
gray: createColorFn(ANSI.gray),
|
|
119
|
-
grey: createColorFn(ANSI.grey),
|
|
120
|
-
// Bright colors
|
|
121
|
-
brightRed: createColorFn(ANSI.brightRed),
|
|
122
|
-
brightGreen: createColorFn(ANSI.brightGreen),
|
|
123
|
-
brightYellow: createColorFn(ANSI.brightYellow),
|
|
124
|
-
brightBlue: createColorFn(ANSI.brightBlue),
|
|
125
|
-
brightMagenta: createColorFn(ANSI.brightMagenta),
|
|
126
|
-
brightCyan: createColorFn(ANSI.brightCyan),
|
|
127
|
-
brightWhite: createColorFn(ANSI.brightWhite),
|
|
128
|
-
// Background colors
|
|
129
|
-
bgBlack: createColorFn(ANSI.bgBlack),
|
|
130
|
-
bgRed: createColorFn(ANSI.bgRed),
|
|
131
|
-
bgGreen: createColorFn(ANSI.bgGreen),
|
|
132
|
-
bgYellow: createColorFn(ANSI.bgYellow),
|
|
133
|
-
bgBlue: createColorFn(ANSI.bgBlue),
|
|
134
|
-
bgMagenta: createColorFn(ANSI.bgMagenta),
|
|
135
|
-
bgCyan: createColorFn(ANSI.bgCyan),
|
|
136
|
-
bgWhite: createColorFn(ANSI.bgWhite),
|
|
137
|
-
// Semantic colors
|
|
138
|
-
success: createColorFn(ANSI.green),
|
|
139
|
-
error: createColorFn(ANSI.red),
|
|
140
|
-
warning: createColorFn(ANSI.yellow),
|
|
141
|
-
info: createColorFn(ANSI.blue),
|
|
142
|
-
muted: createColorFn(ANSI.gray),
|
|
143
|
-
// Combine multiple styles
|
|
144
|
-
combine: (...codes) => (text) => {
|
|
145
|
-
if (!supportsColor())
|
|
146
|
-
return text;
|
|
147
|
-
return `${codes.join('')}${text}${ANSI.reset}`;
|
|
148
|
-
},
|
|
149
|
-
// Strip ANSI codes from string
|
|
150
|
-
strip: (text) => text.replace(/[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g, ''),
|
|
151
|
-
// Get raw ANSI codes
|
|
152
|
-
codes: ANSI
|
|
153
|
-
};
|
|
154
|
-
// Aliases for convenience
|
|
155
|
-
const { bold, dim, italic, underline, red, green, yellow, blue, magenta, cyan, white, gray, grey, success, error, warning, info, muted, strip } = pigment;
|
|
156
|
-
/**
|
|
157
|
-
* Default VLD theme for error formatting
|
|
158
|
-
*/
|
|
159
|
-
const vldTheme = {
|
|
160
|
-
error: red,
|
|
161
|
-
success: green,
|
|
162
|
-
warning: yellow,
|
|
163
|
-
info: blue,
|
|
164
|
-
muted: dim,
|
|
165
|
-
path: cyan,
|
|
166
|
-
value: yellow,
|
|
167
|
-
key: bold,
|
|
168
|
-
symbol: red
|
|
169
|
-
};
|
|
170
|
-
/**
|
|
171
|
-
* Create a custom theme
|
|
172
|
-
*/
|
|
173
|
-
function createTheme(overrides = {}) {
|
|
174
|
-
return { ...vldTheme, ...overrides };
|
|
175
|
-
}
|
|
176
|
-
|
|
177
|
-
export { blue, bold, createTheme, cyan, pigment as default, dim, error, gray, green, grey, info, italic, magenta, muted, pigment, red, strip, success, supportsColor, underline, vldTheme, warning, white, yellow };
|
|
178
|
-
//# sourceMappingURL=pigment.js.map
|
|
1
|
+
function e(){return("undefined"==typeof process||!process.env?.NO_COLOR)&&(!("undefined"==typeof process||!process.env?.FORCE_COLOR)||!("undefined"==typeof process||!process.stdout?.isTTY))}const r={reset:"[0m",bold:"[1m",dim:"[2m",italic:"[3m",underline:"[4m",blink:"[5m",inverse:"[7m",hidden:"[8m",strikethrough:"[9m",black:"[30m",red:"[31m",green:"[32m",yellow:"[33m",blue:"[34m",magenta:"[35m",cyan:"[36m",white:"[37m",gray:"[90m",grey:"[90m",brightRed:"[91m",brightGreen:"[92m",brightYellow:"[93m",brightBlue:"[94m",brightMagenta:"[95m",brightCyan:"[96m",brightWhite:"[97m",bgBlack:"[40m",bgRed:"[41m",bgGreen:"[42m",bgYellow:"[43m",bgBlue:"[44m",bgMagenta:"[45m",bgCyan:"[46m",bgWhite:"[47m",bgBrightRed:"[101m",bgBrightGreen:"[102m",bgBrightYellow:"[103m",bgBrightBlue:"[104m",bgBrightMagenta:"[105m",bgBrightCyan:"[106m",bgBrightWhite:"[107m"},g=new RegExp("[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]","g");function t(g){const t=e();return e=>t&&""!==e?`${g}${e}${r.reset}`:e}const i={supportsColor:e,reset:e=>e,bold:t(r.bold),dim:t(r.dim),italic:t(r.italic),underline:t(r.underline),inverse:t(r.inverse),hidden:t(r.hidden),strikethrough:t(r.strikethrough),black:t(r.black),red:t(r.red),green:t(r.green),yellow:t(r.yellow),blue:t(r.blue),magenta:t(r.magenta),cyan:t(r.cyan),white:t(r.white),gray:t(r.gray),grey:t(r.grey),brightRed:t(r.brightRed),brightGreen:t(r.brightGreen),brightYellow:t(r.brightYellow),brightBlue:t(r.brightBlue),brightMagenta:t(r.brightMagenta),brightCyan:t(r.brightCyan),brightWhite:t(r.brightWhite),bgBlack:t(r.bgBlack),bgRed:t(r.bgRed),bgGreen:t(r.bgGreen),bgYellow:t(r.bgYellow),bgBlue:t(r.bgBlue),bgMagenta:t(r.bgMagenta),bgCyan:t(r.bgCyan),bgWhite:t(r.bgWhite),success:t(r.green),error:t(r.red),warning:t(r.yellow),info:t(r.blue),muted:t(r.gray),combine:(...g)=>t=>e()?`${g.join("")}${t}${r.reset}`:t,strip:e=>e.replace(g,""),codes:r},{bold:n,dim:b,italic:l,underline:a,red:m,green:h,yellow:o,blue:s,magenta:d,cyan:u,white:c,gray:y,grey:w,success:p,error:B,warning:f,info:R,muted:k,strip:C}=i,Y={error:m,success:h,warning:o,info:s,muted:b,path:u,value:o,key:n,symbol:m};function G(e={}){return{...Y,...e}}export{s as blue,n as bold,G as createTheme,u as cyan,i as default,b as dim,B as error,y as gray,h as green,w as grey,R as info,l as italic,d as magenta,k as muted,i as pigment,m as red,C as strip,p as success,e as supportsColor,a as underline,Y as vldTheme,f as warning,c as white,o as yellow};
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -3,6 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This module exports all plugin-related functionality.
|
|
5
5
|
*/
|
|
6
|
-
export type { VldContext, VldPlugin, VldKernelInstance, VldKernelOptions, ValidatorFactory, TransformFactory, CodecFactory, HookContext, PluginBuilder, PluginMeta, PluginHooks } from './types';
|
|
7
|
-
export { createVldKernel, definePlugin, getVldKernel, resetVldKernel, usePlugin } from '../kernel';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
6
|
+
export type { VldContext, VldPlugin, VldKernelInstance, VldKernelOptions, ValidatorFactory, TransformFactory, CodecFactory, HookContext, PluginBuilder, PluginMeta, PluginHooks } from './types.js';
|
|
7
|
+
export { createVldKernel, definePlugin, getVldKernel, resetVldKernel, usePlugin } from '../kernel.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{createVldKernel,definePlugin,getVldKernel,resetVldKernel,usePlugin}from"../kernel.js";
|
package/dist/plugins/types.d.ts
CHANGED
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* This module defines the plugin system interfaces and types
|
|
5
5
|
* for extending VLD with custom validators, transforms, and codecs.
|
|
6
6
|
*/
|
|
7
|
-
import type { VldBase } from '../validators/base';
|
|
8
|
-
import type { VldError } from '../errors';
|
|
9
|
-
import type { ParseResult } from '../validators/base';
|
|
10
|
-
import type { Locale } from '../locales';
|
|
7
|
+
import type { VldBase } from '../validators/base.js';
|
|
8
|
+
import type { VldError } from '../errors.js';
|
|
9
|
+
import type { ParseResult } from '../validators/base.js';
|
|
10
|
+
import type { Locale } from '../locales/index.js';
|
|
11
11
|
/**
|
|
12
12
|
* Plugin metadata
|
|
13
13
|
*/
|
|
@@ -183,4 +183,3 @@ export interface PluginBuilder {
|
|
|
183
183
|
install(fn: VldPlugin['install']): this;
|
|
184
184
|
build(): VldPlugin;
|
|
185
185
|
}
|
|
186
|
-
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SchemaMetadata, VldBase } from './validators/base.js';
|
|
2
|
+
/**
|
|
3
|
+
* Strongly typed schema metadata registry.
|
|
4
|
+
*
|
|
5
|
+
* Registries keep metadata outside schema instances, which preserves validator
|
|
6
|
+
* immutability and mirrors Zod 4's registry model while keeping VLD's existing
|
|
7
|
+
* .meta() wrapper API backward compatible.
|
|
8
|
+
*/
|
|
9
|
+
export interface SchemaRegistry<TMetadata extends Record<string, unknown> = SchemaMetadata> {
|
|
10
|
+
add<TSchema extends VldBase<any, any>>(schema: TSchema, metadata: TMetadata): TSchema;
|
|
11
|
+
get(schema: VldBase<any, any>): TMetadata | undefined;
|
|
12
|
+
has(schema: VldBase<any, any>): boolean;
|
|
13
|
+
remove(schema: VldBase<any, any>): boolean;
|
|
14
|
+
clear(): void;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Create a schema metadata registry.
|
|
18
|
+
*/
|
|
19
|
+
export declare function registry<TMetadata extends Record<string, unknown> = SchemaMetadata>(): SchemaRegistry<TMetadata>;
|
|
20
|
+
/**
|
|
21
|
+
* Global JSON Schema/OpenAPI compatible metadata registry.
|
|
22
|
+
*/
|
|
23
|
+
export declare const globalRegistry: SchemaRegistry<SchemaMetadata>;
|
package/dist/registry.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class t{constructor(){this.metadata=new WeakMap}add(t,a){return this.metadata.set(t,{...a}),t}get(t){const a=this.metadata.get(t);return a?{...a}:void 0}has(t){return this.metadata.has(t)}remove(t){return this.metadata.delete(t)}clear(){this.metadata=new WeakMap}}function a(){return new t}const e=a();export{e as globalRegistry,a as registry};
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
* JSON Schema support for VLD validators
|
|
3
3
|
* Provides conversion between VLD schemas and JSON Schema
|
|
4
4
|
*/
|
|
5
|
-
import { VldBase } from '../validators/base';
|
|
5
|
+
import { VldBase } from '../validators/base.js';
|
|
6
|
+
import { type SchemaRegistry } from '../registry.js';
|
|
6
7
|
/**
|
|
7
8
|
* JSON Schema definition types
|
|
8
9
|
*/
|
|
@@ -15,18 +16,23 @@ export type JSONSchemaDefinition = {
|
|
|
15
16
|
enum?: unknown[];
|
|
16
17
|
const?: unknown;
|
|
17
18
|
format?: string;
|
|
19
|
+
formatMinimum?: string;
|
|
20
|
+
formatMaximum?: string;
|
|
21
|
+
formatExclusiveMinimum?: string;
|
|
22
|
+
formatExclusiveMaximum?: string;
|
|
18
23
|
pattern?: string;
|
|
19
24
|
minLength?: number;
|
|
20
25
|
maxLength?: number;
|
|
21
26
|
minimum?: number;
|
|
22
27
|
maximum?: number;
|
|
23
|
-
exclusiveMinimum?: number;
|
|
24
|
-
exclusiveMaximum?: number;
|
|
28
|
+
exclusiveMinimum?: number | boolean;
|
|
29
|
+
exclusiveMaximum?: number | boolean;
|
|
25
30
|
multipleOf?: number;
|
|
26
31
|
properties?: Record<string, JSONSchemaDefinition>;
|
|
27
32
|
additionalProperties?: boolean | JSONSchemaDefinition;
|
|
28
33
|
required?: string[];
|
|
29
|
-
items?: JSONSchemaDefinition | JSONSchemaDefinition[];
|
|
34
|
+
items?: JSONSchemaDefinition | JSONSchemaDefinition[] | false;
|
|
35
|
+
prefixItems?: JSONSchemaDefinition[];
|
|
30
36
|
contains?: JSONSchemaDefinition;
|
|
31
37
|
minItems?: number;
|
|
32
38
|
maxItems?: number;
|
|
@@ -42,14 +48,28 @@ export type JSONSchemaDefinition = {
|
|
|
42
48
|
deprecated?: boolean;
|
|
43
49
|
readOnly?: boolean;
|
|
44
50
|
writeOnly?: boolean;
|
|
51
|
+
nullable?: boolean;
|
|
52
|
+
'x-vld-type'?: string;
|
|
53
|
+
'x-vld-minimum'?: string;
|
|
54
|
+
'x-vld-maximum'?: string;
|
|
55
|
+
'x-vld-exclusiveMinimum'?: string;
|
|
56
|
+
'x-vld-exclusiveMaximum'?: string;
|
|
45
57
|
};
|
|
46
58
|
/**
|
|
47
59
|
* Options for JSON Schema conversion
|
|
48
60
|
*/
|
|
49
61
|
export interface ToJSONSchemaOptions {
|
|
50
|
-
target?: 'draft-07' | 'draft-2019-09' | 'draft-2020-12';
|
|
62
|
+
target?: 'draft-04' | 'draft-4' | 'draft-07' | 'draft-7' | 'draft-2019-09' | 'draft-2020-12' | 'openapi-3.0' | (string & {});
|
|
51
63
|
includeMetadata?: boolean;
|
|
52
64
|
includeExamples?: boolean;
|
|
65
|
+
/** Match Zod's default throw/any behavior, or opt into VLD extensions. */
|
|
66
|
+
unrepresentable?: 'throw' | 'any' | 'vld';
|
|
67
|
+
/** Select the input or output side of codecs and pipes. */
|
|
68
|
+
io?: 'input' | 'output';
|
|
69
|
+
}
|
|
70
|
+
export interface FromJSONSchemaOptions {
|
|
71
|
+
defaultTarget?: 'draft-2020-12' | 'draft-7' | 'draft-4' | 'openapi-3.0';
|
|
72
|
+
registry?: SchemaRegistry<Record<string, unknown>>;
|
|
53
73
|
}
|
|
54
74
|
/**
|
|
55
75
|
* Convert a VLD schema to JSON Schema
|
|
@@ -63,5 +83,4 @@ export declare function toJSONSchema<T>(schema: VldBase<unknown, T>, options?: T
|
|
|
63
83
|
* @param json The JSON Schema definition
|
|
64
84
|
* @returns A VLD schema
|
|
65
85
|
*/
|
|
66
|
-
export declare function fromJSONSchema(json: JSONSchemaDefinition): VldBase<unknown, unknown>;
|
|
67
|
-
//# sourceMappingURL=json-schema.d.ts.map
|
|
86
|
+
export declare function fromJSONSchema(json: JSONSchemaDefinition | boolean, options?: FromJSONSchemaOptions): VldBase<unknown, unknown>;
|
package/dist/utils/security.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Security utilities for prototype pollution protection
|
|
3
|
-
* BUG-NEW-018 & BUG-NEW-020 FIX: Centralized comprehensive dangerous key detection
|
|
4
3
|
*/
|
|
5
4
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* @param key The property key to check
|
|
9
|
-
* @returns true if the key is dangerous, false otherwise
|
|
5
|
+
* Return true if a property key would, if assigned, mutate the prototype
|
|
6
|
+
* chain or accessor behavior of the target object.
|
|
10
7
|
*/
|
|
11
8
|
export declare function isDangerousKey(key: string): boolean;
|
|
12
|
-
//# sourceMappingURL=security.d.ts.map
|
package/dist/v3/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{$brand,$input,$output,NEVER,TimePrecision,ZodFirstPartyTypeKind,ZodIssueCode,_ZodString,_default,_function,any,array,base64,base64Bytes,base64url,bigint,boolean,catch,check,cidrv4,cidrv6,clone,codec,coerce,config,core,createLogger,createNoOpLogger,creditCard,cuid,cuid2,custom,date,decode,decodeAsync,deepPartial,default,describe,disableLogging,discriminatedUnion,e164,email,emoji,enableDebug,encode,encodeAsync,endsWith,enum,exactOptional,file,float32,float64,formatError,fromJSONSchema,_function as function,getErrorMap,getLogger,gt,gte,guid,hash,hex,hexBytes,hostname,httpUrl,includes,initLogger,input,instanceof,int,int32,int64,intersection,ipv4,ipv6,iso,json,jwt,keyof,ksuid,lazy,length,literal,locales,looseObject,looseRecord,lowercase,lt,lte,mac,map,mapSchema,maxLength,maxSize,meta,mime,minLength,minSize,multipleOf,nan,nanoid,nativeEnum,negative,never,nonnegative,nonoptional,nonpositive,normalize,null,nullable,nullish,number,object,optional,output,overwrite,parse,parseAsync,partialRecord,pipe,positive,prefault,preprocess,promise,property,readonly,record,refine,regex,regexes,safeDecode,safeDecodeAsync,safeEncode,safeEncodeAsync,safeParse,safeParseAsync,set,setErrorMap,setLogLevel,size,slugify,startsWith,strictObject,string,stringFormat,stringbool,superRefine,symbol,templateLiteral,toJSONSchema,toLowerCase,toUpperCase,transform,trim,tuple,uint32,uint64,uint8Array,ulid,undefined,union,unknown,uppercase,url,util,uuid,uuidv4,uuidv6,uuidv7,default as v,void,xid,xor,z}from"../index.js";export{Err,Ok,ResultUtils,all,failure,flatMap,fromNullable,isErr,isOk,isResult,mapErr,match,success,tryCatch,tryCatchAsync,unwrap,unwrapOr}from"../compat/result.js";export{VldBase,VldMeta,VldBrand as ZodBranded,VldCatch as ZodCatch,VldDefault as ZodDefault,VldExactOptional as ZodExactOptional,VldMeta as ZodMeta,VldRefine as ZodNonOptional,VldNullable as ZodNullable,VldOptional as ZodOptional,VldPipe as ZodPipe,VldPrefault as ZodPrefault,VldPreprocess as ZodPreprocess,VldReadonly as ZodReadonly,VldTransform as ZodTransform,VldBase as ZodType}from"../validators/base.js";export{V as VldError,V as ZodError,V as ZodRealError}from"../chunks/errors-core-Cqi4-9ew.js";export{VldIntersection,VldIntersection as ZodIntersection}from"../validators/intersection.js";export{VldAny as ZodAny}from"../validators/any.js";export{VldArray as ZodArray}from"../validators/array.js";export{VldStringFormat as ZodBase64,VldStringFormat as ZodBase64URL,VldStringFormat as ZodCIDRv4,VldStringFormat as ZodCIDRv6,VldStringFormat as ZodCUID,VldStringFormat as ZodCUID2,VldStringFormat as ZodCreditCard,VldStringFormat as ZodCustomStringFormat,VldStringFormat as ZodE164,VldStringFormat as ZodEmail,VldStringFormat as ZodEmoji,VldStringFormat as ZodGUID,VldStringFormat as ZodIPv4,VldStringFormat as ZodIPv6,VldStringFormat as ZodISODate,VldStringFormat as ZodISODateTime,VldStringFormat as ZodISODuration,VldStringFormat as ZodISOTime,VldStringFormat as ZodJWT,VldStringFormat as ZodKSUID,VldStringFormat as ZodMAC,VldStringFormat as ZodNanoID,VldStringFormat as ZodStringFormat,VldStringFormat as ZodULID,VldStringFormat as ZodURL,VldStringFormat as ZodUUID,VldStringFormat as ZodXID}from"../validators/string-formats.js";export{VldBigInt as ZodBigInt,VldBigInt as ZodBigIntFormat}from"../validators/bigint.js";export{VldBoolean as ZodBoolean}from"../validators/boolean.js";export{VldCodec as ZodCodec}from"../validators/codec.js";export{VldCustom as ZodCustom,VldCustom as ZodSuccess}from"../validators/custom.js";export{VldDate as ZodDate}from"../validators/date.js";export{VldDiscriminatedUnion as ZodDiscriminatedUnion}from"../validators/discriminated-union.js";export{VldEnum as ZodEnum}from"../validators/enum.js";export{VldFile as ZodFile}from"../validators/file.js";export{VldFunction as ZodFunction}from"../validators/function.js";export{VldJson as ZodJSON}from"../validators/json.js";export{VldLazy as ZodLazy}from"../validators/lazy.js";export{VldLiteral as ZodLiteral}from"../validators/literal.js";export{VldMap as ZodMap}from"../validators/map.js";export{VldNan as ZodNaN}from"../validators/nan.js";export{VldNever as ZodNever}from"../validators/never.js";export{VldNull as ZodNull}from"../validators/null.js";export{VldNumber as ZodNumber,VldNumber as ZodNumberFormat}from"../validators/number.js";export{VldObject as ZodObject}from"../validators/object.js";export{VldPromise as ZodPromise}from"../validators/promise.js";export{VldRecord as ZodRecord}from"../validators/record.js";export{VldSet as ZodSet}from"../validators/set.js";export{VldString as ZodString}from"../validators/string.js";export{VldSymbol as ZodSymbol}from"../validators/symbol.js";export{VldTemplateLiteral as ZodTemplateLiteral}from"../validators/template-literal.js";export{VldTuple as ZodTuple}from"../validators/tuple.js";export{VldUndefined as ZodUndefined}from"../validators/undefined.js";export{VldUnion as ZodUnion}from"../validators/union.js";export{VldUnknown as ZodUnknown}from"../validators/unknown.js";export{VldVoid as ZodVoid}from"../validators/void.js";export{VldXor as ZodXor}from"../validators/xor.js";export{b as base64Json,a as base64ToBytes,c as base64ToUint8Array,d as base64UrlToBytes,e as base64urlToBytes,f as bytesToUtf8,g as epochMillisToDate,h as epochSecondsToDate,i as hexLowerToBytes,j as hexToBytes,k as hexToUint8Array,l as invertCodec,m as isoDatetimeToDate,n as jsonCodec,o as jwtPayload,p as numberToBigInt,s as stringToBigInt,q as stringToBoolean,r as stringToHttpURL,t as stringToInt,u as stringToNumber,v as stringToURL,w as stringToUint8Array,x as uint8ArrayToBase64,y as uint8ArrayToBase64Url,z as uint8ArrayToHex,A as uint8ArrayToString,B as uriComponent,C as utf8ToBytes}from"../chunks/index-CkbfQQ4n.js";export{blue,bold,createTheme,cyan,dim,gray,green,grey,italic,magenta,default as pigment,red,strip,supportsColor,underline,vldTheme,white,yellow}from"../pigment.js";export{createEmitter,createEventBus,withEmitter}from"../compat/emitter.js";export{createVldKernel,definePlugin,getVldKernel,resetVldKernel,usePlugin}from"../kernel.js";export{flattenError,prettifyError,prettifyErrorColored,prettifyErrorPlain,treeifyError}from"../errors.js";export{getLocale,getMessages,getSupportedLocales,isLocaleLoaded,isLocaleSupported,registerLocale,setLocale}from"../locales/runtime.js";export{globalRegistry,registry}from"../registry.js";export{s as setLocaleAsync}from"../chunks/index-yjpbvFgw.js";
|