@oxog/vld 2.0.2 → 2.1.0
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 +75 -1
- package/LICENSE +20 -20
- package/README.md +101 -37
- package/dist/chunks/errors-core-BeiFUtZM.js +81 -0
- package/dist/chunks/{index-CETyGkrv.js → index-0R2ntSud.js} +16 -402
- package/dist/chunks/index-BvH403Yy.js +88 -0
- package/dist/chunks/security-B0Pd_vSY.js +35 -0
- package/dist/chunks/string-BJRQod3t.js +530 -0
- package/dist/cjs/chunks/errors-core-DWxLFs2f.cjs +83 -0
- package/dist/cjs/chunks/index-BkI37108.cjs +538 -0
- package/dist/cjs/chunks/index-Cc3bjUMX.cjs +91 -0
- package/dist/cjs/chunks/security-Dc3Jh13T.cjs +37 -0
- package/dist/cjs/chunks/string-BKZrc4hs.cjs +533 -0
- package/dist/cjs/cli/bin.cjs +506 -0
- package/dist/cjs/cli/index.cjs +209 -0
- package/dist/cjs/codecs/index.cjs +45 -0
- package/dist/{chunks/date-ODue_rtq.js → cjs/coercion/index.cjs} +185 -103
- package/dist/cjs/compat/emitter.cjs +184 -0
- package/dist/cjs/compat/result.cjs +189 -0
- package/dist/cjs/errors.cjs +6 -213
- package/dist/cjs/index.cjs +1558 -9647
- package/dist/cjs/kernel.cjs +415 -0
- package/dist/cjs/locales/af.cjs +108 -0
- package/dist/cjs/locales/ar.cjs +108 -0
- package/dist/cjs/locales/bn.cjs +108 -0
- package/dist/cjs/locales/da.cjs +108 -0
- package/dist/cjs/locales/de.cjs +108 -0
- package/dist/cjs/locales/en.cjs +108 -0
- package/dist/cjs/locales/es-MX.cjs +107 -0
- package/dist/cjs/locales/es.cjs +96 -0
- package/dist/cjs/locales/fi.cjs +108 -0
- package/dist/cjs/locales/fr.cjs +96 -0
- package/dist/cjs/locales/hi.cjs +108 -0
- package/dist/cjs/locales/id.cjs +108 -0
- package/dist/cjs/locales/index.cjs +41 -2875
- package/dist/cjs/locales/it.cjs +108 -0
- package/dist/cjs/locales/ja.cjs +108 -0
- package/dist/cjs/locales/ko.cjs +108 -0
- package/dist/cjs/locales/lazy.cjs +42 -3023
- package/dist/cjs/locales/nl.cjs +108 -0
- package/dist/cjs/locales/no.cjs +108 -0
- package/dist/cjs/locales/pl.cjs +108 -0
- package/dist/cjs/locales/pt-BR.cjs +108 -0
- package/dist/cjs/locales/pt.cjs +108 -0
- package/dist/cjs/locales/ru.cjs +108 -0
- package/dist/cjs/locales/runtime.cjs +51 -0
- package/dist/cjs/locales/sv.cjs +108 -0
- package/dist/cjs/locales/sw.cjs +108 -0
- package/dist/cjs/locales/th.cjs +108 -0
- package/dist/cjs/locales/tr.cjs +108 -0
- package/dist/cjs/locales/vi.cjs +108 -0
- package/dist/cjs/locales/zh.cjs +108 -0
- package/dist/cjs/mini.cjs +121 -7208
- package/dist/cjs/pigment.cjs +207 -0
- package/dist/cjs/plugins/index.cjs +12 -0
- package/dist/cjs/registry.cjs +37 -0
- package/dist/cjs/v3/index.cjs +425 -0
- package/dist/cjs/v4/core/index.cjs +894 -0
- package/dist/cjs/v4/index.cjs +425 -0
- package/dist/cjs/v4/locales/index.cjs +130 -0
- package/dist/cjs/v4/mini/index.cjs +509 -0
- package/dist/cjs/v4-mini/index.cjs +532 -0
- package/dist/cjs/validators/any.cjs +40 -0
- package/dist/cjs/validators/array.cjs +283 -0
- package/dist/cjs/validators/base.cjs +887 -0
- package/dist/cjs/validators/base64.cjs +73 -0
- package/dist/cjs/validators/bigint.cjs +232 -0
- package/dist/cjs/validators/boolean.cjs +146 -0
- package/dist/cjs/validators/codec.cjs +205 -0
- package/dist/cjs/validators/custom.cjs +71 -0
- package/dist/cjs/validators/date.cjs +278 -0
- package/dist/cjs/validators/discriminated-union.cjs +130 -0
- package/dist/cjs/validators/enum.cjs +154 -0
- package/dist/cjs/validators/file.cjs +130 -0
- package/dist/cjs/validators/function.cjs +63 -0
- package/dist/cjs/validators/hex.cjs +70 -0
- package/dist/cjs/validators/index.cjs +123 -0
- package/dist/cjs/validators/intersection.cjs +120 -0
- package/dist/cjs/validators/json.cjs +70 -0
- package/dist/cjs/validators/lazy.cjs +53 -0
- package/dist/cjs/validators/literal.cjs +64 -0
- package/dist/cjs/validators/map.cjs +218 -0
- package/dist/cjs/validators/nan.cjs +41 -0
- package/dist/cjs/validators/never.cjs +36 -0
- package/dist/cjs/validators/null.cjs +43 -0
- package/dist/cjs/validators/number.cjs +427 -0
- package/dist/cjs/validators/object.cjs +868 -0
- package/dist/cjs/validators/promise.cjs +115 -0
- package/dist/cjs/validators/record.cjs +262 -0
- package/dist/cjs/validators/set.cjs +203 -0
- package/dist/cjs/validators/string-bool.cjs +124 -0
- package/dist/cjs/validators/string-formats.cjs +168 -0
- package/dist/cjs/validators/string.cjs +12 -0
- package/dist/cjs/validators/symbol.cjs +62 -0
- package/dist/cjs/validators/template-literal.cjs +108 -0
- package/dist/cjs/validators/tuple.cjs +187 -0
- package/dist/cjs/validators/uint8array.cjs +106 -0
- package/dist/cjs/validators/undefined.cjs +43 -0
- package/dist/cjs/validators/union.cjs +191 -0
- package/dist/cjs/validators/unknown.cjs +40 -0
- package/dist/cjs/validators/void.cjs +48 -0
- package/dist/cjs/validators/xor.cjs +69 -0
- package/dist/cli/bin.d.ts +0 -1
- package/dist/cli/bin.js +407 -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 +205 -0
- package/dist/codecs/index.d.ts +21 -4
- package/dist/codecs/index.js +11 -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 +473 -5
- 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 +0 -1
- package/dist/compat/index.d.ts +4 -5
- package/dist/compat/result.d.ts +1 -2
- package/dist/compat/result.js +0 -1
- package/dist/errors-core.d.ts +39 -0
- package/dist/errors.d.ts +4 -54
- package/dist/errors.js +4 -68
- package/dist/events.d.ts +3 -4
- package/dist/index.d.ts +1195 -600
- package/dist/index.js +1262 -44
- package/dist/kernel.d.ts +2 -3
- package/dist/kernel.js +10 -6
- package/dist/locales/af.d.ts +1 -2
- package/dist/locales/af.js +0 -1
- package/dist/locales/ar.d.ts +1 -2
- package/dist/locales/ar.js +0 -1
- package/dist/locales/bn.d.ts +1 -2
- package/dist/locales/bn.js +0 -1
- package/dist/locales/da.d.ts +1 -2
- package/dist/locales/da.js +0 -1
- package/dist/locales/de.d.ts +1 -2
- package/dist/locales/de.js +0 -1
- package/dist/locales/en.d.ts +1 -2
- package/dist/locales/en.js +0 -1
- package/dist/locales/es-MX.d.ts +1 -2
- package/dist/locales/es-MX.js +0 -1
- package/dist/locales/es.d.ts +1 -2
- package/dist/locales/es.js +0 -1
- package/dist/locales/fi.d.ts +1 -2
- package/dist/locales/fi.js +0 -1
- package/dist/locales/fr.d.ts +1 -2
- package/dist/locales/fr.js +0 -1
- package/dist/locales/hi.d.ts +1 -2
- package/dist/locales/hi.js +0 -1
- package/dist/locales/id.d.ts +1 -2
- package/dist/locales/id.js +0 -1
- package/dist/locales/index.d.ts +10 -15
- package/dist/locales/index.js +28 -2
- package/dist/locales/it.d.ts +1 -2
- package/dist/locales/it.js +0 -1
- package/dist/locales/ja.d.ts +1 -2
- package/dist/locales/ja.js +0 -1
- package/dist/locales/ko.d.ts +1 -2
- package/dist/locales/ko.js +0 -1
- package/dist/locales/lazy.d.ts +4 -26
- package/dist/locales/lazy.js +12 -55
- package/dist/locales/nl.d.ts +1 -2
- package/dist/locales/nl.js +0 -1
- package/dist/locales/no.d.ts +1 -2
- package/dist/locales/no.js +0 -1
- package/dist/locales/pl.d.ts +1 -2
- package/dist/locales/pl.js +0 -1
- package/dist/locales/pt-BR.d.ts +1 -2
- package/dist/locales/pt-BR.js +0 -1
- package/dist/locales/pt.d.ts +1 -2
- package/dist/locales/pt.js +0 -1
- package/dist/locales/ru.d.ts +1 -2
- package/dist/locales/ru.js +0 -1
- package/dist/locales/runtime.d.ts +10 -0
- package/dist/locales/runtime.js +41 -0
- package/dist/locales/sv.d.ts +1 -2
- package/dist/locales/sv.js +0 -1
- package/dist/locales/sw.d.ts +1 -2
- package/dist/locales/sw.js +0 -1
- package/dist/locales/th.d.ts +1 -2
- package/dist/locales/th.js +0 -1
- package/dist/locales/tr.d.ts +1 -2
- package/dist/locales/tr.js +0 -1
- package/dist/locales/types.d.ts +0 -1
- package/dist/locales/vi.d.ts +1 -2
- package/dist/locales/vi.js +0 -1
- package/dist/locales/zh.d.ts +1 -2
- package/dist/locales/zh.js +0 -1
- package/dist/logger.d.ts +0 -1
- package/dist/mini.d.ts +64 -65
- package/dist/mini.js +31 -7
- package/dist/pigment.d.ts +0 -1
- package/dist/pigment.js +6 -4
- 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 +34 -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 +77 -0
- package/dist/utils/security.d.ts +2 -6
- package/dist/v3/index.d.ts +2 -0
- package/dist/v3/index.js +46 -0
- package/dist/v4/core/index.d.ts +260 -0
- package/dist/v4/core/index.js +277 -0
- package/dist/v4/index.d.ts +4 -0
- package/dist/v4/index.js +50 -0
- package/dist/v4/locales/index.d.ts +53 -0
- package/dist/v4/locales/index.js +77 -0
- package/dist/v4/mini/index.d.ts +2 -0
- package/dist/v4/mini/index.js +47 -0
- package/dist/v4-mini/index.d.ts +22 -0
- package/dist/v4-mini/index.js +75 -0
- package/dist/validators/any.d.ts +7 -2
- package/dist/validators/any.js +37 -0
- package/dist/validators/array.d.ts +9 -2
- package/dist/validators/array.js +279 -0
- package/dist/validators/base.d.ts +228 -5
- package/dist/validators/base.js +868 -0
- package/dist/validators/base64.d.ts +1 -2
- package/dist/validators/base64.js +68 -0
- package/dist/validators/bigint.d.ts +21 -3
- package/dist/validators/bigint.js +228 -0
- package/dist/validators/boolean.d.ts +13 -4
- package/dist/validators/boolean.js +142 -0
- package/dist/validators/codec.d.ts +9 -2
- package/dist/validators/codec.js +200 -0
- package/dist/validators/custom.d.ts +15 -2
- package/dist/validators/custom.js +67 -0
- package/dist/validators/date.d.ts +19 -3
- package/dist/validators/date.js +274 -0
- package/dist/validators/discriminated-union.d.ts +4 -3
- package/dist/validators/discriminated-union.js +123 -0
- package/dist/validators/enum.d.ts +10 -7
- package/dist/validators/enum.js +150 -0
- package/dist/validators/file.d.ts +7 -2
- package/dist/validators/file.js +125 -0
- package/dist/validators/function.d.ts +11 -5
- package/dist/validators/function.js +58 -0
- package/dist/validators/hex.d.ts +1 -2
- package/dist/validators/hex.js +65 -0
- package/dist/validators/index.d.ts +38 -38
- package/dist/validators/index.js +35 -5
- package/dist/validators/intersection.d.ts +1 -2
- package/dist/validators/intersection.js +116 -0
- package/dist/validators/json.d.ts +1 -2
- package/dist/validators/json.js +66 -0
- package/dist/validators/lazy.d.ts +5 -9
- package/dist/validators/lazy.js +50 -0
- package/dist/validators/literal.d.ts +2 -2
- package/dist/validators/literal.js +60 -0
- package/dist/validators/map.d.ts +15 -2
- package/dist/validators/map.js +214 -0
- package/dist/validators/nan.d.ts +2 -3
- package/dist/validators/nan.js +38 -0
- package/dist/validators/never.d.ts +1 -2
- package/dist/validators/never.js +32 -0
- package/dist/validators/null.d.ts +3 -3
- package/dist/validators/null.js +40 -0
- package/dist/validators/number.d.ts +80 -21
- package/dist/validators/number.js +423 -0
- package/dist/validators/object.d.ts +30 -9
- package/dist/validators/object.js +864 -0
- package/dist/validators/promise.d.ts +58 -0
- package/dist/validators/promise.js +111 -0
- package/dist/validators/record.d.ts +11 -2
- package/dist/validators/record.js +258 -0
- package/dist/validators/set.d.ts +11 -2
- package/dist/validators/set.js +199 -0
- package/dist/validators/string-bool.d.ts +7 -10
- package/dist/validators/string-bool.js +120 -0
- package/dist/validators/string-formats.d.ts +13 -4
- package/dist/validators/string-formats.js +135 -0
- package/dist/validators/string.d.ts +39 -18
- package/dist/validators/string.js +4 -0
- package/dist/validators/symbol.d.ts +8 -3
- package/dist/validators/symbol.js +58 -0
- package/dist/validators/template-literal.d.ts +1 -2
- package/dist/validators/template-literal.js +103 -0
- package/dist/validators/tuple.d.ts +15 -2
- package/dist/validators/tuple.js +183 -0
- package/dist/validators/uint8array.d.ts +3 -4
- package/dist/validators/uint8array.js +101 -0
- package/dist/validators/undefined.d.ts +3 -3
- package/dist/validators/undefined.js +40 -0
- package/dist/validators/union.d.ts +7 -4
- package/dist/validators/union.js +187 -0
- package/dist/validators/unknown.d.ts +7 -2
- package/dist/{chunks/unknown-SLIH1VCf.js → validators/unknown.js} +12 -3
- package/dist/validators/void.d.ts +3 -2
- package/dist/validators/void.js +44 -0
- package/dist/validators/xor.d.ts +2 -3
- package/dist/validators/xor.js +66 -0
- package/package.json +116 -31
- package/dist/chunks/bigint-DgsCr2dC.js +0 -1709
- package/dist/chunks/bigint-DgsCr2dC.js.map +0 -1
- package/dist/chunks/date-ODue_rtq.js.map +0 -1
- package/dist/chunks/index-BZqWZvVe.js +0 -426
- package/dist/chunks/index-BZqWZvVe.js.map +0 -1
- package/dist/chunks/index-CETyGkrv.js.map +0 -1
- package/dist/chunks/json-o20GFhTh.js +0 -2021
- package/dist/chunks/json-o20GFhTh.js.map +0 -1
- package/dist/chunks/unknown-SLIH1VCf.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/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/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/locales/tr.js
CHANGED
package/dist/locales/types.d.ts
CHANGED
package/dist/locales/vi.d.ts
CHANGED
package/dist/locales/vi.js
CHANGED
package/dist/locales/zh.d.ts
CHANGED
package/dist/locales/zh.js
CHANGED
package/dist/logger.d.ts
CHANGED
package/dist/mini.d.ts
CHANGED
|
@@ -14,71 +14,71 @@
|
|
|
14
14
|
* });
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
|
-
export { VldBase, ParseResult, VldRefine, VldTransform, VldDefault, VldCatch, VldOptional, VldNullable, VldNullish, VldPipe, VldReadonly, VldBrand, VldPreprocess, SuperRefineContext, VldSuperRefine } from './validators/base';
|
|
18
|
-
export { VldString } from './validators/string';
|
|
19
|
-
export { VldNumber } from './validators/number';
|
|
20
|
-
export { VldBoolean } from './validators/boolean';
|
|
21
|
-
export { VldDate } from './validators/date';
|
|
22
|
-
export { VldBigInt } from './validators/bigint';
|
|
23
|
-
export { VldSymbol } from './validators/symbol';
|
|
24
|
-
export { VldStringBool } from './validators/string-bool';
|
|
25
|
-
export { VldArray } from './validators/array';
|
|
26
|
-
export { VldObject } from './validators/object';
|
|
27
|
-
export { VldTuple } from './validators/tuple';
|
|
28
|
-
export { VldRecord } from './validators/record';
|
|
29
|
-
export { VldSet } from './validators/set';
|
|
30
|
-
export { VldMap } from './validators/map';
|
|
31
|
-
export { VldUnion } from './validators/union';
|
|
32
|
-
export { VldIntersection } from './validators/intersection';
|
|
33
|
-
export { VldLiteral } from './validators/literal';
|
|
34
|
-
export { VldEnum } from './validators/enum';
|
|
35
|
-
export { VldAny } from './validators/any';
|
|
36
|
-
export { VldUnknown } from './validators/unknown';
|
|
37
|
-
export { VldVoid } from './validators/void';
|
|
38
|
-
export { VldNever } from './validators/never';
|
|
39
|
-
export { VldNull } from './validators/null';
|
|
40
|
-
export { VldUndefined } from './validators/undefined';
|
|
41
|
-
export { VldNan } from './validators/nan';
|
|
42
|
-
export { VldLazy } from './validators/lazy';
|
|
43
|
-
export { VldDiscriminatedUnion } from './validators/discriminated-union';
|
|
44
|
-
export { VldXor } from './validators/xor';
|
|
45
|
-
export { VldJson } from './validators/json';
|
|
46
|
-
import type { VldBase } from './validators/base';
|
|
17
|
+
export { VldBase, ParseResult, VldRefine, VldTransform, VldDefault, VldCatch, VldOptional, VldNullable, VldNullish, VldPipe, VldReadonly, VldBrand, VldPreprocess, SuperRefineContext, VldSuperRefine } from './validators/base.js';
|
|
18
|
+
export { VldString } from './validators/string.js';
|
|
19
|
+
export { VldNumber } from './validators/number.js';
|
|
20
|
+
export { VldBoolean } from './validators/boolean.js';
|
|
21
|
+
export { VldDate } from './validators/date.js';
|
|
22
|
+
export { VldBigInt } from './validators/bigint.js';
|
|
23
|
+
export { VldSymbol } from './validators/symbol.js';
|
|
24
|
+
export { VldStringBool } from './validators/string-bool.js';
|
|
25
|
+
export { VldArray } from './validators/array.js';
|
|
26
|
+
export { VldObject } from './validators/object.js';
|
|
27
|
+
export { VldTuple } from './validators/tuple.js';
|
|
28
|
+
export { VldRecord } from './validators/record.js';
|
|
29
|
+
export { VldSet } from './validators/set.js';
|
|
30
|
+
export { VldMap } from './validators/map.js';
|
|
31
|
+
export { VldUnion } from './validators/union.js';
|
|
32
|
+
export { VldIntersection } from './validators/intersection.js';
|
|
33
|
+
export { VldLiteral } from './validators/literal.js';
|
|
34
|
+
export { VldEnum } from './validators/enum.js';
|
|
35
|
+
export { VldAny } from './validators/any.js';
|
|
36
|
+
export { VldUnknown } from './validators/unknown.js';
|
|
37
|
+
export { VldVoid } from './validators/void.js';
|
|
38
|
+
export { VldNever } from './validators/never.js';
|
|
39
|
+
export { VldNull } from './validators/null.js';
|
|
40
|
+
export { VldUndefined } from './validators/undefined.js';
|
|
41
|
+
export { VldNan } from './validators/nan.js';
|
|
42
|
+
export { VldLazy } from './validators/lazy.js';
|
|
43
|
+
export { VldDiscriminatedUnion } from './validators/discriminated-union.js';
|
|
44
|
+
export { VldXor } from './validators/xor.js';
|
|
45
|
+
export { VldJson } from './validators/json.js';
|
|
46
|
+
import type { VldBase } from './validators/base.js';
|
|
47
47
|
/** Infer the output type of a validator */
|
|
48
48
|
export type Infer<T extends VldBase<any, any>> = T extends VldBase<any, infer U> ? U : never;
|
|
49
49
|
/** Infer the input type of a validator */
|
|
50
50
|
export type Input<T extends VldBase<any, any>> = T extends VldBase<infer I, any> ? I : never;
|
|
51
51
|
/** Infer the output type of a validator (alias for Infer) */
|
|
52
52
|
export type Output<T extends VldBase<any, any>> = Infer<T>;
|
|
53
|
-
import { VldString } from './validators/string';
|
|
54
|
-
import { VldNumber } from './validators/number';
|
|
55
|
-
import { VldBoolean } from './validators/boolean';
|
|
56
|
-
import { VldDate } from './validators/date';
|
|
57
|
-
import { VldBigInt } from './validators/bigint';
|
|
58
|
-
import { VldSymbol } from './validators/symbol';
|
|
59
|
-
import { VldStringBool } from './validators/string-bool';
|
|
60
|
-
import { VldArray } from './validators/array';
|
|
61
|
-
import { VldObject } from './validators/object';
|
|
62
|
-
import { VldTuple } from './validators/tuple';
|
|
63
|
-
import { VldRecord } from './validators/record';
|
|
64
|
-
import { VldSet } from './validators/set';
|
|
65
|
-
import { VldMap } from './validators/map';
|
|
66
|
-
import { VldUnion } from './validators/union';
|
|
67
|
-
import { VldIntersection } from './validators/intersection';
|
|
68
|
-
import { VldLiteral } from './validators/literal';
|
|
69
|
-
import { VldEnum } from './validators/enum';
|
|
70
|
-
import { VldAny } from './validators/any';
|
|
71
|
-
import { VldUnknown } from './validators/unknown';
|
|
72
|
-
import { VldVoid } from './validators/void';
|
|
73
|
-
import { VldNever } from './validators/never';
|
|
74
|
-
import { VldNull } from './validators/null';
|
|
75
|
-
import { VldUndefined } from './validators/undefined';
|
|
76
|
-
import { VldNan } from './validators/nan';
|
|
77
|
-
import { VldLazy } from './validators/lazy';
|
|
78
|
-
import { VldDiscriminatedUnion } from './validators/discriminated-union';
|
|
79
|
-
import { VldXor } from './validators/xor';
|
|
80
|
-
import { VldJson } from './validators/json';
|
|
81
|
-
import { VldOptional, VldNullable, VldNullish, VldPreprocess } from './validators/base';
|
|
53
|
+
import { VldString } from './validators/string.js';
|
|
54
|
+
import { VldNumber } from './validators/number.js';
|
|
55
|
+
import { VldBoolean } from './validators/boolean.js';
|
|
56
|
+
import { VldDate } from './validators/date.js';
|
|
57
|
+
import { VldBigInt } from './validators/bigint.js';
|
|
58
|
+
import { VldSymbol } from './validators/symbol.js';
|
|
59
|
+
import { VldStringBool } from './validators/string-bool.js';
|
|
60
|
+
import { VldArray } from './validators/array.js';
|
|
61
|
+
import { VldObject } from './validators/object.js';
|
|
62
|
+
import { VldTuple } from './validators/tuple.js';
|
|
63
|
+
import { VldRecord } from './validators/record.js';
|
|
64
|
+
import { VldSet } from './validators/set.js';
|
|
65
|
+
import { VldMap } from './validators/map.js';
|
|
66
|
+
import { VldUnion } from './validators/union.js';
|
|
67
|
+
import { VldIntersection } from './validators/intersection.js';
|
|
68
|
+
import { VldLiteral } from './validators/literal.js';
|
|
69
|
+
import { VldEnum } from './validators/enum.js';
|
|
70
|
+
import { VldAny } from './validators/any.js';
|
|
71
|
+
import { VldUnknown } from './validators/unknown.js';
|
|
72
|
+
import { VldVoid } from './validators/void.js';
|
|
73
|
+
import { VldNever } from './validators/never.js';
|
|
74
|
+
import { VldNull } from './validators/null.js';
|
|
75
|
+
import { VldUndefined } from './validators/undefined.js';
|
|
76
|
+
import { VldNan } from './validators/nan.js';
|
|
77
|
+
import { VldLazy } from './validators/lazy.js';
|
|
78
|
+
import { VldDiscriminatedUnion } from './validators/discriminated-union.js';
|
|
79
|
+
import { VldXor } from './validators/xor.js';
|
|
80
|
+
import { VldJson } from './validators/json.js';
|
|
81
|
+
import { VldOptional, VldNullable, VldNullish, VldPreprocess } from './validators/base.js';
|
|
82
82
|
/** Create a string validator */
|
|
83
83
|
export declare const string: () => VldString;
|
|
84
84
|
/** Create a number validator */
|
|
@@ -159,11 +159,11 @@ export declare const nullable: <TInput, TOutput>(validator: VldBase<TInput, TOut
|
|
|
159
159
|
export declare const nullish: <TInput, TOutput>(validator: VldBase<TInput, TOutput>) => VldNullish<TInput, TOutput>;
|
|
160
160
|
/** Preprocess input before validation */
|
|
161
161
|
export declare const preprocess: <TInput, TOutput>(preprocessor: (input: unknown) => unknown, schema: VldBase<TInput, TOutput>) => VldPreprocess<TInput, TOutput>;
|
|
162
|
-
import { VldCoerceString } from './coercion/string';
|
|
163
|
-
import { VldCoerceNumber } from './coercion/number';
|
|
164
|
-
import { VldCoerceBoolean } from './coercion/boolean';
|
|
165
|
-
import { VldCoerceDate } from './coercion/date';
|
|
166
|
-
import { VldCoerceBigInt } from './coercion/bigint';
|
|
162
|
+
import { VldCoerceString } from './coercion/string.js';
|
|
163
|
+
import { VldCoerceNumber } from './coercion/number.js';
|
|
164
|
+
import { VldCoerceBoolean } from './coercion/boolean.js';
|
|
165
|
+
import { VldCoerceDate } from './coercion/date.js';
|
|
166
|
+
import { VldCoerceBigInt } from './coercion/bigint.js';
|
|
167
167
|
/** Coercion validators - convert values to target type before validation */
|
|
168
168
|
export declare const coerce: {
|
|
169
169
|
/** Coerce to string */
|
|
@@ -179,4 +179,3 @@ export declare const coerce: {
|
|
|
179
179
|
};
|
|
180
180
|
/** NEVER constant for use in transforms - Zod 4 API parity */
|
|
181
181
|
export declare const NEVER: VldNever;
|
|
182
|
-
//# sourceMappingURL=mini.d.ts.map
|
package/dist/mini.js
CHANGED
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export {
|
|
3
|
-
import { V as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
1
|
+
import { VldNullable, VldNullish, VldOptional, VldPreprocess } from './validators/base.js';
|
|
2
|
+
export { VldBase, VldBrand, VldCatch, VldDefault, VldPipe, VldReadonly, VldRefine, VldSuperRefine, VldTransform } from './validators/base.js';
|
|
3
|
+
import { V as VldString } from './chunks/string-BJRQod3t.js';
|
|
4
|
+
import { VldNumber } from './validators/number.js';
|
|
5
|
+
import { VldBoolean } from './validators/boolean.js';
|
|
6
|
+
import { VldDate } from './validators/date.js';
|
|
7
|
+
import { VldBigInt } from './validators/bigint.js';
|
|
8
|
+
import { VldSymbol } from './validators/symbol.js';
|
|
9
|
+
import { VldStringBool } from './validators/string-bool.js';
|
|
10
|
+
import { VldArray } from './validators/array.js';
|
|
11
|
+
import { VldObject } from './validators/object.js';
|
|
12
|
+
import { VldTuple } from './validators/tuple.js';
|
|
13
|
+
import { VldRecord } from './validators/record.js';
|
|
14
|
+
import { VldSet } from './validators/set.js';
|
|
15
|
+
import { VldMap } from './validators/map.js';
|
|
16
|
+
import { VldUnion } from './validators/union.js';
|
|
17
|
+
import { VldIntersection } from './validators/intersection.js';
|
|
18
|
+
import { VldLiteral } from './validators/literal.js';
|
|
19
|
+
import { VldEnum } from './validators/enum.js';
|
|
20
|
+
import { VldAny } from './validators/any.js';
|
|
21
|
+
import { VldUnknown } from './validators/unknown.js';
|
|
22
|
+
import { VldVoid } from './validators/void.js';
|
|
23
|
+
import { VldNever } from './validators/never.js';
|
|
24
|
+
import { VldNull } from './validators/null.js';
|
|
25
|
+
import { VldUndefined } from './validators/undefined.js';
|
|
26
|
+
import { VldNan } from './validators/nan.js';
|
|
27
|
+
import { VldLazy } from './validators/lazy.js';
|
|
28
|
+
import { VldDiscriminatedUnion } from './validators/discriminated-union.js';
|
|
29
|
+
import { VldXor } from './validators/xor.js';
|
|
30
|
+
import { VldJson } from './validators/json.js';
|
|
31
|
+
import { VldCoerceBigInt, VldCoerceDate, VldCoerceBoolean, VldCoerceNumber, VldCoerceString } from './coercion/index.js';
|
|
7
32
|
|
|
8
33
|
/**
|
|
9
34
|
* VLD Mini - Tree-Shakable Functional API
|
|
@@ -129,4 +154,3 @@ const coerce = {
|
|
|
129
154
|
const NEVER = VldNever.create();
|
|
130
155
|
|
|
131
156
|
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
|
package/dist/pigment.d.ts
CHANGED
package/dist/pigment.js
CHANGED
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
*/
|
|
11
11
|
function supportsColor() {
|
|
12
12
|
// Check for NO_COLOR environment variable
|
|
13
|
-
if (typeof process !== 'undefined' && process.env?.NO_COLOR) {
|
|
13
|
+
if (typeof process !== 'undefined' && process.env?.['NO_COLOR']) {
|
|
14
14
|
return false;
|
|
15
15
|
}
|
|
16
16
|
// Check for FORCE_COLOR environment variable
|
|
17
|
-
if (typeof process !== 'undefined' && process.env?.FORCE_COLOR) {
|
|
17
|
+
if (typeof process !== 'undefined' && process.env?.['FORCE_COLOR']) {
|
|
18
18
|
return true;
|
|
19
19
|
}
|
|
20
20
|
// Check for TTY
|
|
@@ -79,6 +79,9 @@ const ANSI = {
|
|
|
79
79
|
bgBrightCyan: '\x1b[106m',
|
|
80
80
|
bgBrightWhite: '\x1b[107m'
|
|
81
81
|
};
|
|
82
|
+
/* eslint-disable no-control-regex */
|
|
83
|
+
const ANSI_ESCAPE_PATTERN = new RegExp('[\\u001b\\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]', 'g');
|
|
84
|
+
/* eslint-enable no-control-regex */
|
|
82
85
|
/**
|
|
83
86
|
* Create a color function
|
|
84
87
|
*/
|
|
@@ -147,7 +150,7 @@ const pigment = {
|
|
|
147
150
|
return `${codes.join('')}${text}${ANSI.reset}`;
|
|
148
151
|
},
|
|
149
152
|
// Strip ANSI codes from string
|
|
150
|
-
strip: (text) => text.replace(
|
|
153
|
+
strip: (text) => text.replace(ANSI_ESCAPE_PATTERN, ''),
|
|
151
154
|
// Get raw ANSI codes
|
|
152
155
|
codes: ANSI
|
|
153
156
|
};
|
|
@@ -175,4 +178,3 @@ function createTheme(overrides = {}) {
|
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
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
|
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,34 @@
|
|
|
1
|
+
class WeakSchemaRegistry {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.metadata = new WeakMap();
|
|
4
|
+
}
|
|
5
|
+
add(schema, metadata) {
|
|
6
|
+
this.metadata.set(schema, { ...metadata });
|
|
7
|
+
return schema;
|
|
8
|
+
}
|
|
9
|
+
get(schema) {
|
|
10
|
+
const metadata = this.metadata.get(schema);
|
|
11
|
+
return metadata ? { ...metadata } : undefined;
|
|
12
|
+
}
|
|
13
|
+
has(schema) {
|
|
14
|
+
return this.metadata.has(schema);
|
|
15
|
+
}
|
|
16
|
+
remove(schema) {
|
|
17
|
+
return this.metadata.delete(schema);
|
|
18
|
+
}
|
|
19
|
+
clear() {
|
|
20
|
+
this.metadata = new WeakMap();
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Create a schema metadata registry.
|
|
25
|
+
*/
|
|
26
|
+
function registry() {
|
|
27
|
+
return new WeakSchemaRegistry();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Global JSON Schema/OpenAPI compatible metadata registry.
|
|
31
|
+
*/
|
|
32
|
+
const globalRegistry = registry();
|
|
33
|
+
|
|
34
|
+
export { globalRegistry, registry };
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* JSON Schema support for VLD validators
|
|
3
|
+
* Provides conversion between VLD schemas and JSON Schema
|
|
4
|
+
*/
|
|
5
|
+
import { VldBase } from '../validators/base.js';
|
|
6
|
+
/**
|
|
7
|
+
* JSON Schema definition types
|
|
8
|
+
*/
|
|
9
|
+
export type JSONSchemaDefinition = {
|
|
10
|
+
$id?: string;
|
|
11
|
+
$schema?: string;
|
|
12
|
+
$ref?: string;
|
|
13
|
+
$defs?: Record<string, JSONSchemaDefinition>;
|
|
14
|
+
type?: string | string[];
|
|
15
|
+
enum?: unknown[];
|
|
16
|
+
const?: unknown;
|
|
17
|
+
format?: string;
|
|
18
|
+
formatMinimum?: string;
|
|
19
|
+
formatMaximum?: string;
|
|
20
|
+
formatExclusiveMinimum?: string;
|
|
21
|
+
formatExclusiveMaximum?: string;
|
|
22
|
+
pattern?: string;
|
|
23
|
+
minLength?: number;
|
|
24
|
+
maxLength?: number;
|
|
25
|
+
minimum?: number;
|
|
26
|
+
maximum?: number;
|
|
27
|
+
exclusiveMinimum?: number | boolean;
|
|
28
|
+
exclusiveMaximum?: number | boolean;
|
|
29
|
+
multipleOf?: number;
|
|
30
|
+
properties?: Record<string, JSONSchemaDefinition>;
|
|
31
|
+
additionalProperties?: boolean | JSONSchemaDefinition;
|
|
32
|
+
required?: string[];
|
|
33
|
+
items?: JSONSchemaDefinition | JSONSchemaDefinition[] | false;
|
|
34
|
+
prefixItems?: JSONSchemaDefinition[];
|
|
35
|
+
contains?: JSONSchemaDefinition;
|
|
36
|
+
minItems?: number;
|
|
37
|
+
maxItems?: number;
|
|
38
|
+
uniqueItems?: boolean;
|
|
39
|
+
anyOf?: JSONSchemaDefinition[];
|
|
40
|
+
allOf?: JSONSchemaDefinition[];
|
|
41
|
+
oneOf?: JSONSchemaDefinition[];
|
|
42
|
+
not?: JSONSchemaDefinition;
|
|
43
|
+
title?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
default?: unknown;
|
|
46
|
+
examples?: unknown[];
|
|
47
|
+
deprecated?: boolean;
|
|
48
|
+
readOnly?: boolean;
|
|
49
|
+
writeOnly?: boolean;
|
|
50
|
+
nullable?: boolean;
|
|
51
|
+
'x-vld-type'?: string;
|
|
52
|
+
'x-vld-minimum'?: string;
|
|
53
|
+
'x-vld-maximum'?: string;
|
|
54
|
+
'x-vld-exclusiveMinimum'?: string;
|
|
55
|
+
'x-vld-exclusiveMaximum'?: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Options for JSON Schema conversion
|
|
59
|
+
*/
|
|
60
|
+
export interface ToJSONSchemaOptions {
|
|
61
|
+
target?: 'draft-04' | 'draft-4' | 'draft-07' | 'draft-7' | 'draft-2019-09' | 'draft-2020-12' | 'openapi-3.0' | (string & {});
|
|
62
|
+
includeMetadata?: boolean;
|
|
63
|
+
includeExamples?: boolean;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Convert a VLD schema to JSON Schema
|
|
67
|
+
* @param schema The VLD schema to convert
|
|
68
|
+
* @param options Conversion options
|
|
69
|
+
* @returns JSON Schema definition
|
|
70
|
+
*/
|
|
71
|
+
export declare function toJSONSchema<T>(schema: VldBase<unknown, T>, options?: ToJSONSchemaOptions): JSONSchemaDefinition;
|
|
72
|
+
/**
|
|
73
|
+
* Convert a JSON Schema to a VLD schema
|
|
74
|
+
* @param json The JSON Schema definition
|
|
75
|
+
* @returns A VLD schema
|
|
76
|
+
*/
|
|
77
|
+
export declare function fromJSONSchema(json: JSONSchemaDefinition): 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,46 @@
|
|
|
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, cuid, cuid2, custom, date, decode, decodeAsync, 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, 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, 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';
|
|
2
|
+
export { Err, Ok, ResultUtils, all, failure, flatMap, fromNullable, isErr, isOk, isResult, mapErr, match, success, tryCatch, tryCatchAsync, unwrap, unwrapOr } from '../compat/result.js';
|
|
3
|
+
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';
|
|
4
|
+
export { V as VldError, V as ZodError, V as ZodRealError } from '../chunks/errors-core-BeiFUtZM.js';
|
|
5
|
+
export { VldIntersection, VldIntersection as ZodIntersection } from '../validators/intersection.js';
|
|
6
|
+
export { VldAny as ZodAny } from '../validators/any.js';
|
|
7
|
+
export { VldArray as ZodArray } from '../validators/array.js';
|
|
8
|
+
export { VldStringFormat as ZodBase64, VldStringFormat as ZodBase64URL, VldStringFormat as ZodCIDRv4, VldStringFormat as ZodCIDRv6, VldStringFormat as ZodCUID, VldStringFormat as ZodCUID2, 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';
|
|
9
|
+
export { VldBigInt as ZodBigInt, VldBigInt as ZodBigIntFormat } from '../validators/bigint.js';
|
|
10
|
+
export { VldBoolean as ZodBoolean } from '../validators/boolean.js';
|
|
11
|
+
export { VldCodec as ZodCodec } from '../validators/codec.js';
|
|
12
|
+
export { VldCustom as ZodCustom, VldCustom as ZodSuccess } from '../validators/custom.js';
|
|
13
|
+
export { VldDate as ZodDate } from '../validators/date.js';
|
|
14
|
+
export { VldDiscriminatedUnion as ZodDiscriminatedUnion } from '../validators/discriminated-union.js';
|
|
15
|
+
export { VldEnum as ZodEnum } from '../validators/enum.js';
|
|
16
|
+
export { VldFile as ZodFile } from '../validators/file.js';
|
|
17
|
+
export { VldFunction as ZodFunction } from '../validators/function.js';
|
|
18
|
+
export { VldJson as ZodJSON } from '../validators/json.js';
|
|
19
|
+
export { VldLazy as ZodLazy } from '../validators/lazy.js';
|
|
20
|
+
export { VldLiteral as ZodLiteral } from '../validators/literal.js';
|
|
21
|
+
export { VldMap as ZodMap } from '../validators/map.js';
|
|
22
|
+
export { VldNan as ZodNaN } from '../validators/nan.js';
|
|
23
|
+
export { VldNever as ZodNever } from '../validators/never.js';
|
|
24
|
+
export { VldNull as ZodNull } from '../validators/null.js';
|
|
25
|
+
export { VldNumber as ZodNumber, VldNumber as ZodNumberFormat } from '../validators/number.js';
|
|
26
|
+
export { VldObject as ZodObject } from '../validators/object.js';
|
|
27
|
+
export { VldPromise as ZodPromise } from '../validators/promise.js';
|
|
28
|
+
export { VldRecord as ZodRecord } from '../validators/record.js';
|
|
29
|
+
export { VldSet as ZodSet } from '../validators/set.js';
|
|
30
|
+
export { V as ZodString } from '../chunks/string-BJRQod3t.js';
|
|
31
|
+
export { VldSymbol as ZodSymbol } from '../validators/symbol.js';
|
|
32
|
+
export { VldTemplateLiteral as ZodTemplateLiteral } from '../validators/template-literal.js';
|
|
33
|
+
export { VldTuple as ZodTuple } from '../validators/tuple.js';
|
|
34
|
+
export { VldUndefined as ZodUndefined } from '../validators/undefined.js';
|
|
35
|
+
export { VldUnion as ZodUnion } from '../validators/union.js';
|
|
36
|
+
export { VldUnknown as ZodUnknown } from '../validators/unknown.js';
|
|
37
|
+
export { VldVoid as ZodVoid } from '../validators/void.js';
|
|
38
|
+
export { VldXor as ZodXor } from '../validators/xor.js';
|
|
39
|
+
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-0R2ntSud.js';
|
|
40
|
+
export { blue, bold, createTheme, cyan, dim, gray, green, grey, italic, magenta, default as pigment, red, strip, supportsColor, underline, vldTheme, white, yellow } from '../pigment.js';
|
|
41
|
+
export { createEmitter, createEventBus, withEmitter } from '../compat/emitter.js';
|
|
42
|
+
export { createVldKernel, definePlugin, getVldKernel, resetVldKernel, usePlugin } from '../kernel.js';
|
|
43
|
+
export { flattenError, prettifyError, prettifyErrorColored, prettifyErrorPlain, treeifyError } from '../errors.js';
|
|
44
|
+
export { getLocale, getMessages, getSupportedLocales, isLocaleLoaded, isLocaleSupported, registerLocale, setLocale } from '../locales/runtime.js';
|
|
45
|
+
export { globalRegistry, registry } from '../registry.js';
|
|
46
|
+
export { s as setLocaleAsync } from '../chunks/index-BvH403Yy.js';
|