bguard 0.5.0 → 0.6.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/README.md +72 -2
- package/lib/InferType.d.mts +1 -1
- package/lib/InferType.d.ts +1 -1
- package/lib/asserts/array/index.d.mts +7 -3
- package/lib/asserts/array/index.d.ts +7 -3
- package/lib/asserts/array/index.js +5 -11
- package/lib/asserts/array/index.js.map +1 -1
- package/lib/asserts/array/index.mjs +5 -11
- package/lib/asserts/array/index.mjs.map +1 -1
- package/lib/asserts/array/maxArrayLength.d.mts +3 -1
- package/lib/asserts/array/maxArrayLength.d.ts +3 -1
- package/lib/asserts/array/maxArrayLength.js +3 -12
- package/lib/asserts/array/maxArrayLength.js.map +1 -1
- package/lib/asserts/array/maxArrayLength.mjs +3 -12
- package/lib/asserts/array/maxArrayLength.mjs.map +1 -1
- package/lib/asserts/array/minArrayLength.d.mts +3 -1
- package/lib/asserts/array/minArrayLength.d.ts +3 -1
- package/lib/asserts/array/minArrayLength.js +3 -12
- package/lib/asserts/array/minArrayLength.js.map +1 -1
- package/lib/asserts/array/minArrayLength.mjs +3 -12
- package/lib/asserts/array/minArrayLength.mjs.map +1 -1
- package/lib/asserts/bigint/bigintMax.d.mts +3 -1
- package/lib/asserts/bigint/bigintMax.d.ts +3 -1
- package/lib/asserts/bigint/bigintMax.js +3 -12
- package/lib/asserts/bigint/bigintMax.js.map +1 -1
- package/lib/asserts/bigint/bigintMax.mjs +3 -12
- package/lib/asserts/bigint/bigintMax.mjs.map +1 -1
- package/lib/asserts/bigint/bigintMaxExcluded.d.mts +3 -1
- package/lib/asserts/bigint/bigintMaxExcluded.d.ts +3 -1
- package/lib/asserts/bigint/bigintMaxExcluded.js +3 -12
- package/lib/asserts/bigint/bigintMaxExcluded.js.map +1 -1
- package/lib/asserts/bigint/bigintMaxExcluded.mjs +3 -12
- package/lib/asserts/bigint/bigintMaxExcluded.mjs.map +1 -1
- package/lib/asserts/bigint/bigintMin.d.mts +3 -1
- package/lib/asserts/bigint/bigintMin.d.ts +3 -1
- package/lib/asserts/bigint/bigintMin.js +3 -12
- package/lib/asserts/bigint/bigintMin.js.map +1 -1
- package/lib/asserts/bigint/bigintMin.mjs +3 -12
- package/lib/asserts/bigint/bigintMin.mjs.map +1 -1
- package/lib/asserts/bigint/bigintMinExcluded.d.mts +3 -1
- package/lib/asserts/bigint/bigintMinExcluded.d.ts +3 -1
- package/lib/asserts/bigint/bigintMinExcluded.js +3 -12
- package/lib/asserts/bigint/bigintMinExcluded.js.map +1 -1
- package/lib/asserts/bigint/bigintMinExcluded.mjs +3 -12
- package/lib/asserts/bigint/bigintMinExcluded.mjs.map +1 -1
- package/lib/asserts/bigint/index.d.mts +30 -4
- package/lib/asserts/bigint/index.d.ts +30 -4
- package/lib/asserts/bigint/index.js +8 -15
- package/lib/asserts/bigint/index.js.map +1 -1
- package/lib/asserts/bigint/index.mjs +8 -15
- package/lib/asserts/bigint/index.mjs.map +1 -1
- package/lib/asserts/boolean/index.d.mts +25 -3
- package/lib/asserts/boolean/index.d.ts +25 -3
- package/lib/asserts/boolean/index.js +6 -12
- package/lib/asserts/boolean/index.js.map +1 -1
- package/lib/asserts/boolean/index.mjs +6 -12
- package/lib/asserts/boolean/index.mjs.map +1 -1
- package/lib/asserts/date/dateMax.d.mts +3 -1
- package/lib/asserts/date/dateMax.d.ts +3 -1
- package/lib/asserts/date/dateMax.js +5 -22
- package/lib/asserts/date/dateMax.js.map +1 -1
- package/lib/asserts/date/dateMax.mjs +5 -22
- package/lib/asserts/date/dateMax.mjs.map +1 -1
- package/lib/asserts/date/dateMin.d.mts +3 -1
- package/lib/asserts/date/dateMin.d.ts +3 -1
- package/lib/asserts/date/dateMin.js +5 -22
- package/lib/asserts/date/dateMin.js.map +1 -1
- package/lib/asserts/date/dateMin.mjs +5 -22
- package/lib/asserts/date/dateMin.mjs.map +1 -1
- package/lib/asserts/date/index.d.mts +6 -3
- package/lib/asserts/date/index.d.ts +6 -3
- package/lib/asserts/date/index.js +5 -11
- package/lib/asserts/date/index.js.map +1 -1
- package/lib/asserts/date/index.mjs +5 -11
- package/lib/asserts/date/index.mjs.map +1 -1
- package/lib/asserts/mix/equalTo.d.mts +3 -1
- package/lib/asserts/mix/equalTo.d.ts +3 -1
- package/lib/asserts/mix/equalTo.js +3 -3
- package/lib/asserts/mix/equalTo.mjs +2 -2
- package/lib/asserts/mix/index.d.mts +3 -4
- package/lib/asserts/mix/index.d.ts +3 -4
- package/lib/asserts/mix/index.js +5 -10
- package/lib/asserts/mix/index.js.map +1 -1
- package/lib/asserts/mix/index.mjs +5 -10
- package/lib/asserts/mix/index.mjs.map +1 -1
- package/lib/asserts/mix/oneOfValues.d.mts +3 -1
- package/lib/asserts/mix/oneOfValues.d.ts +3 -1
- package/lib/asserts/mix/oneOfValues.js +3 -3
- package/lib/asserts/mix/oneOfValues.mjs +2 -2
- package/lib/asserts/number/index.d.mts +28 -3
- package/lib/asserts/number/index.d.ts +28 -3
- package/lib/asserts/number/index.js +8 -15
- package/lib/asserts/number/index.js.map +1 -1
- package/lib/asserts/number/index.mjs +8 -15
- package/lib/asserts/number/index.mjs.map +1 -1
- package/lib/asserts/number/max.d.mts +3 -1
- package/lib/asserts/number/max.d.ts +3 -1
- package/lib/asserts/number/max.js +3 -12
- package/lib/asserts/number/max.js.map +1 -1
- package/lib/asserts/number/max.mjs +3 -12
- package/lib/asserts/number/max.mjs.map +1 -1
- package/lib/asserts/number/maxExcluded.d.mts +3 -1
- package/lib/asserts/number/maxExcluded.d.ts +3 -1
- package/lib/asserts/number/maxExcluded.js +3 -12
- package/lib/asserts/number/maxExcluded.js.map +1 -1
- package/lib/asserts/number/maxExcluded.mjs +3 -12
- package/lib/asserts/number/maxExcluded.mjs.map +1 -1
- package/lib/asserts/number/min.d.mts +3 -1
- package/lib/asserts/number/min.d.ts +3 -1
- package/lib/asserts/number/min.js +3 -12
- package/lib/asserts/number/min.js.map +1 -1
- package/lib/asserts/number/min.mjs +3 -12
- package/lib/asserts/number/min.mjs.map +1 -1
- package/lib/asserts/number/minExcluded.d.mts +3 -1
- package/lib/asserts/number/minExcluded.d.ts +3 -1
- package/lib/asserts/number/minExcluded.js +3 -12
- package/lib/asserts/number/minExcluded.js.map +1 -1
- package/lib/asserts/number/minExcluded.mjs +3 -12
- package/lib/asserts/number/minExcluded.mjs.map +1 -1
- package/lib/asserts/number/negative.d.mts +3 -1
- package/lib/asserts/number/negative.d.ts +3 -1
- package/lib/asserts/number/negative.js +3 -12
- package/lib/asserts/number/negative.js.map +1 -1
- package/lib/asserts/number/negative.mjs +3 -12
- package/lib/asserts/number/negative.mjs.map +1 -1
- package/lib/asserts/number/positive.d.mts +3 -1
- package/lib/asserts/number/positive.d.ts +3 -1
- package/lib/asserts/number/positive.js +3 -12
- package/lib/asserts/number/positive.js.map +1 -1
- package/lib/asserts/number/positive.mjs +3 -12
- package/lib/asserts/number/positive.mjs.map +1 -1
- package/lib/asserts/object/index.d.mts +26 -3
- package/lib/asserts/object/index.d.ts +26 -3
- package/lib/asserts/object/index.js +5 -11
- package/lib/asserts/object/index.js.map +1 -1
- package/lib/asserts/object/index.mjs +5 -11
- package/lib/asserts/object/index.mjs.map +1 -1
- package/lib/asserts/object/maxKeys.d.mts +3 -1
- package/lib/asserts/object/maxKeys.d.ts +3 -1
- package/lib/asserts/object/maxKeys.js +3 -15
- package/lib/asserts/object/maxKeys.js.map +1 -1
- package/lib/asserts/object/maxKeys.mjs +3 -15
- package/lib/asserts/object/maxKeys.mjs.map +1 -1
- package/lib/asserts/string/atLeastOneDigit.d.mts +3 -1
- package/lib/asserts/string/atLeastOneDigit.d.ts +3 -1
- package/lib/asserts/string/atLeastOneDigit.js +3 -13
- package/lib/asserts/string/atLeastOneDigit.js.map +1 -1
- package/lib/asserts/string/atLeastOneDigit.mjs +3 -13
- package/lib/asserts/string/atLeastOneDigit.mjs.map +1 -1
- package/lib/asserts/string/atLeastOneLowerChar.d.mts +3 -1
- package/lib/asserts/string/atLeastOneLowerChar.d.ts +3 -1
- package/lib/asserts/string/atLeastOneLowerChar.js +3 -14
- package/lib/asserts/string/atLeastOneLowerChar.js.map +1 -1
- package/lib/asserts/string/atLeastOneLowerChar.mjs +3 -14
- package/lib/asserts/string/atLeastOneLowerChar.mjs.map +1 -1
- package/lib/asserts/string/atLeastOneSpecialChar.d.mts +3 -1
- package/lib/asserts/string/atLeastOneSpecialChar.d.ts +3 -1
- package/lib/asserts/string/atLeastOneSpecialChar.js +4 -18
- package/lib/asserts/string/atLeastOneSpecialChar.js.map +1 -1
- package/lib/asserts/string/atLeastOneSpecialChar.mjs +3 -17
- package/lib/asserts/string/atLeastOneSpecialChar.mjs.map +1 -1
- package/lib/asserts/string/atLeastOneUpperChar.d.mts +3 -1
- package/lib/asserts/string/atLeastOneUpperChar.d.ts +3 -1
- package/lib/asserts/string/atLeastOneUpperChar.js +3 -14
- package/lib/asserts/string/atLeastOneUpperChar.js.map +1 -1
- package/lib/asserts/string/atLeastOneUpperChar.mjs +3 -14
- package/lib/asserts/string/atLeastOneUpperChar.mjs.map +1 -1
- package/lib/asserts/string/contains.d.mts +3 -1
- package/lib/asserts/string/contains.d.ts +3 -1
- package/lib/asserts/string/contains.js +3 -14
- package/lib/asserts/string/contains.js.map +1 -1
- package/lib/asserts/string/contains.mjs +3 -14
- package/lib/asserts/string/contains.mjs.map +1 -1
- package/lib/asserts/string/email.d.mts +3 -1
- package/lib/asserts/string/email.d.ts +3 -1
- package/lib/asserts/string/email.js +3 -13
- package/lib/asserts/string/email.js.map +1 -1
- package/lib/asserts/string/email.mjs +3 -13
- package/lib/asserts/string/email.mjs.map +1 -1
- package/lib/asserts/string/endsWith.d.mts +3 -1
- package/lib/asserts/string/endsWith.d.ts +3 -1
- package/lib/asserts/string/endsWith.js +3 -14
- package/lib/asserts/string/endsWith.js.map +1 -1
- package/lib/asserts/string/endsWith.mjs +3 -14
- package/lib/asserts/string/endsWith.mjs.map +1 -1
- package/lib/asserts/string/index.d.mts +29 -3
- package/lib/asserts/string/index.d.ts +29 -3
- package/lib/asserts/string/index.js +8 -15
- package/lib/asserts/string/index.js.map +1 -1
- package/lib/asserts/string/index.mjs +8 -15
- package/lib/asserts/string/index.mjs.map +1 -1
- package/lib/asserts/string/isValidDate.d.mts +3 -1
- package/lib/asserts/string/isValidDate.d.ts +3 -1
- package/lib/asserts/string/isValidDate.js +3 -17
- package/lib/asserts/string/isValidDate.js.map +1 -1
- package/lib/asserts/string/isValidDate.mjs +3 -17
- package/lib/asserts/string/isValidDate.mjs.map +1 -1
- package/lib/asserts/string/isValidDateTime.d.mts +3 -1
- package/lib/asserts/string/isValidDateTime.d.ts +3 -1
- package/lib/asserts/string/isValidDateTime.js +3 -24
- package/lib/asserts/string/isValidDateTime.js.map +1 -1
- package/lib/asserts/string/isValidDateTime.mjs +3 -24
- package/lib/asserts/string/isValidDateTime.mjs.map +1 -1
- package/lib/asserts/string/isValidTime.d.mts +3 -1
- package/lib/asserts/string/isValidTime.d.ts +3 -1
- package/lib/asserts/string/isValidTime.js +3 -24
- package/lib/asserts/string/isValidTime.js.map +1 -1
- package/lib/asserts/string/isValidTime.mjs +3 -24
- package/lib/asserts/string/isValidTime.mjs.map +1 -1
- package/lib/asserts/string/lowerCase.d.mts +3 -1
- package/lib/asserts/string/lowerCase.d.ts +3 -1
- package/lib/asserts/string/lowerCase.js +3 -12
- package/lib/asserts/string/lowerCase.js.map +1 -1
- package/lib/asserts/string/lowerCase.mjs +3 -12
- package/lib/asserts/string/lowerCase.mjs.map +1 -1
- package/lib/asserts/string/maxLength.d.mts +3 -1
- package/lib/asserts/string/maxLength.d.ts +3 -1
- package/lib/asserts/string/maxLength.js +3 -12
- package/lib/asserts/string/maxLength.js.map +1 -1
- package/lib/asserts/string/maxLength.mjs +3 -12
- package/lib/asserts/string/maxLength.mjs.map +1 -1
- package/lib/asserts/string/minLength.d.mts +3 -1
- package/lib/asserts/string/minLength.d.ts +3 -1
- package/lib/asserts/string/minLength.js +3 -12
- package/lib/asserts/string/minLength.js.map +1 -1
- package/lib/asserts/string/minLength.mjs +3 -12
- package/lib/asserts/string/minLength.mjs.map +1 -1
- package/lib/asserts/string/regExp.d.mts +3 -1
- package/lib/asserts/string/regExp.d.ts +3 -1
- package/lib/asserts/string/regExp.js +3 -12
- package/lib/asserts/string/regExp.js.map +1 -1
- package/lib/asserts/string/regExp.mjs +3 -12
- package/lib/asserts/string/regExp.mjs.map +1 -1
- package/lib/asserts/string/startsWith.d.mts +3 -1
- package/lib/asserts/string/startsWith.d.ts +3 -1
- package/lib/asserts/string/startsWith.js +3 -14
- package/lib/asserts/string/startsWith.js.map +1 -1
- package/lib/asserts/string/startsWith.mjs +3 -14
- package/lib/asserts/string/startsWith.mjs.map +1 -1
- package/lib/asserts/string/upperCase.d.mts +3 -1
- package/lib/asserts/string/upperCase.d.ts +3 -1
- package/lib/asserts/string/upperCase.js +3 -14
- package/lib/asserts/string/upperCase.js.map +1 -1
- package/lib/asserts/string/upperCase.mjs +3 -14
- package/lib/asserts/string/upperCase.mjs.map +1 -1
- package/lib/asserts/string/uuid.d.mts +3 -1
- package/lib/asserts/string/uuid.d.ts +3 -1
- package/lib/asserts/string/uuid.js +3 -15
- package/lib/asserts/string/uuid.js.map +1 -1
- package/lib/asserts/string/uuid.mjs +3 -15
- package/lib/asserts/string/uuid.mjs.map +1 -1
- package/lib/asserts/string/uuidV1.d.mts +3 -1
- package/lib/asserts/string/uuidV1.d.ts +3 -1
- package/lib/asserts/string/uuidV1.js +3 -15
- package/lib/asserts/string/uuidV1.js.map +1 -1
- package/lib/asserts/string/uuidV1.mjs +3 -15
- package/lib/asserts/string/uuidV1.mjs.map +1 -1
- package/lib/asserts/string/uuidV2.d.mts +3 -1
- package/lib/asserts/string/uuidV2.d.ts +3 -1
- package/lib/asserts/string/uuidV2.js +3 -15
- package/lib/asserts/string/uuidV2.js.map +1 -1
- package/lib/asserts/string/uuidV2.mjs +3 -15
- package/lib/asserts/string/uuidV2.mjs.map +1 -1
- package/lib/asserts/string/uuidV3.d.mts +3 -1
- package/lib/asserts/string/uuidV3.d.ts +3 -1
- package/lib/asserts/string/uuidV3.js +3 -15
- package/lib/asserts/string/uuidV3.js.map +1 -1
- package/lib/asserts/string/uuidV3.mjs +3 -15
- package/lib/asserts/string/uuidV3.mjs.map +1 -1
- package/lib/asserts/string/uuidV4.d.mts +3 -1
- package/lib/asserts/string/uuidV4.d.ts +3 -1
- package/lib/asserts/string/uuidV4.js +3 -15
- package/lib/asserts/string/uuidV4.js.map +1 -1
- package/lib/asserts/string/uuidV4.mjs +3 -15
- package/lib/asserts/string/uuidV4.mjs.map +1 -1
- package/lib/asserts/string/uuidV5.d.mts +3 -1
- package/lib/asserts/string/uuidV5.d.ts +3 -1
- package/lib/asserts/string/uuidV5.js +3 -15
- package/lib/asserts/string/uuidV5.js.map +1 -1
- package/lib/asserts/string/uuidV5.mjs +3 -15
- package/lib/asserts/string/uuidV5.mjs.map +1 -1
- package/lib/asserts/string/validUrl.d.mts +3 -1
- package/lib/asserts/string/validUrl.d.ts +3 -1
- package/lib/asserts/string/validUrl.js +3 -19
- package/lib/asserts/string/validUrl.js.map +1 -1
- package/lib/asserts/string/validUrl.mjs +3 -19
- package/lib/asserts/string/validUrl.mjs.map +1 -1
- package/lib/chunk-22254THF.mjs +21 -0
- package/lib/chunk-22254THF.mjs.map +1 -0
- package/lib/chunk-22VHHJSS.js +28 -0
- package/lib/chunk-22VHHJSS.js.map +1 -0
- package/lib/chunk-23QTSXPQ.js +18 -0
- package/lib/chunk-23QTSXPQ.js.map +1 -0
- package/lib/chunk-24LO7MNY.js +18 -0
- package/lib/chunk-24LO7MNY.js.map +1 -0
- package/lib/{chunk-ASZW6XRM.mjs → chunk-2ANPCB4O.mjs} +4 -2
- package/lib/{chunk-ASZW6XRM.mjs.map → chunk-2ANPCB4O.mjs.map} +1 -1
- package/lib/chunk-2D3HCTJV.js +18 -0
- package/lib/chunk-2D3HCTJV.js.map +1 -0
- package/lib/chunk-2ESDKTV4.js +18 -0
- package/lib/chunk-2ESDKTV4.js.map +1 -0
- package/lib/chunk-2HGS4STD.js +48 -0
- package/lib/chunk-2HGS4STD.js.map +1 -0
- package/lib/chunk-2IPGGARK.mjs +21 -0
- package/lib/chunk-2IPGGARK.mjs.map +1 -0
- package/lib/chunk-3W2COCXV.js +18 -0
- package/lib/chunk-3W2COCXV.js.map +1 -0
- package/lib/chunk-4N5J426R.mjs +20 -0
- package/lib/chunk-4N5J426R.mjs.map +1 -0
- package/lib/chunk-4UPXP4I3.js +25 -0
- package/lib/chunk-4UPXP4I3.js.map +1 -0
- package/lib/{chunk-EMOOEIPZ.mjs → chunk-4ZKU4RJL.mjs} +2 -2
- package/lib/chunk-4ZKU4RJL.mjs.map +1 -0
- package/lib/chunk-5NYVRFG3.mjs +48 -0
- package/lib/chunk-5NYVRFG3.mjs.map +1 -0
- package/lib/chunk-62EKGBXF.js +21 -0
- package/lib/chunk-62EKGBXF.js.map +1 -0
- package/lib/chunk-6JPYR2TS.js +23 -0
- package/lib/chunk-6JPYR2TS.js.map +1 -0
- package/lib/chunk-6LPQRAFN.js +30 -0
- package/lib/chunk-6LPQRAFN.js.map +1 -0
- package/lib/{chunk-XG6K6N3A.mjs → chunk-6WKSLMJG.mjs} +10 -7
- package/lib/chunk-6WKSLMJG.mjs.map +1 -0
- package/lib/chunk-7JL66G7G.mjs +20 -0
- package/lib/chunk-7JL66G7G.mjs.map +1 -0
- package/lib/chunk-AJHBPMZT.mjs +19 -0
- package/lib/chunk-AJHBPMZT.mjs.map +1 -0
- package/lib/chunk-AQCV7PB4.mjs +28 -0
- package/lib/chunk-AQCV7PB4.mjs.map +1 -0
- package/lib/chunk-ARIYSQMH.js +20 -0
- package/lib/chunk-ARIYSQMH.js.map +1 -0
- package/lib/{chunk-42J6CHIO.js → chunk-AXKX5BGH.js} +4 -2
- package/lib/chunk-AXKX5BGH.js.map +1 -0
- package/lib/chunk-BRFUFNU4.js +18 -0
- package/lib/chunk-BRFUFNU4.js.map +1 -0
- package/lib/chunk-C2VSTWID.js +18 -0
- package/lib/chunk-C2VSTWID.js.map +1 -0
- package/lib/chunk-C44KAKMR.js +21 -0
- package/lib/chunk-C44KAKMR.js.map +1 -0
- package/lib/chunk-D6G32F2K.js +69 -0
- package/lib/chunk-D6G32F2K.js.map +1 -0
- package/lib/chunk-DCPRPCZ3.js +20 -0
- package/lib/chunk-DCPRPCZ3.js.map +1 -0
- package/lib/{chunk-BURPSYZ3.js → chunk-DED5KDLM.js} +18 -14
- package/lib/chunk-DED5KDLM.js.map +1 -0
- package/lib/chunk-DFYP4GKE.js +21 -0
- package/lib/chunk-DFYP4GKE.js.map +1 -0
- package/lib/chunk-ENZ5WDUQ.js +18 -0
- package/lib/chunk-ENZ5WDUQ.js.map +1 -0
- package/lib/chunk-FI737YZJ.js +19 -0
- package/lib/chunk-FI737YZJ.js.map +1 -0
- package/lib/chunk-GFWZQ4XW.mjs +30 -0
- package/lib/chunk-GFWZQ4XW.mjs.map +1 -0
- package/lib/chunk-GGWJJFXY.mjs +20 -0
- package/lib/chunk-GGWJJFXY.mjs.map +1 -0
- package/lib/chunk-H2M4FCRZ.mjs +21 -0
- package/lib/chunk-H2M4FCRZ.mjs.map +1 -0
- package/lib/chunk-H4OW6OUF.js +21 -0
- package/lib/chunk-H4OW6OUF.js.map +1 -0
- package/lib/chunk-HD37VXPZ.mjs +19 -0
- package/lib/chunk-HD37VXPZ.mjs.map +1 -0
- package/lib/chunk-HPIF2CMT.js +18 -0
- package/lib/chunk-HPIF2CMT.js.map +1 -0
- package/lib/chunk-HUWO5UKU.js +64 -0
- package/lib/chunk-HUWO5UKU.js.map +1 -0
- package/lib/chunk-HWVM4SYU.mjs +18 -0
- package/lib/chunk-HWVM4SYU.mjs.map +1 -0
- package/lib/chunk-IDDU6B6T.js +20 -0
- package/lib/chunk-IDDU6B6T.js.map +1 -0
- package/lib/chunk-KRCOKWAB.mjs +18 -0
- package/lib/chunk-KRCOKWAB.mjs.map +1 -0
- package/lib/chunk-LXZTBF7F.js +18 -0
- package/lib/chunk-LXZTBF7F.js.map +1 -0
- package/lib/chunk-M2GOQ7TZ.mjs +21 -0
- package/lib/chunk-M2GOQ7TZ.mjs.map +1 -0
- package/lib/{chunk-CCNK27CX.mjs → chunk-M3HYPZLE.mjs} +14 -10
- package/lib/chunk-M3HYPZLE.mjs.map +1 -0
- package/lib/chunk-MCQHWS3E.mjs +18 -0
- package/lib/chunk-MCQHWS3E.mjs.map +1 -0
- package/lib/chunk-MHWPSQB3.js +20 -0
- package/lib/chunk-MHWPSQB3.js.map +1 -0
- package/lib/chunk-N3EHGKZV.mjs +25 -0
- package/lib/chunk-N3EHGKZV.mjs.map +1 -0
- package/lib/chunk-NBR3QGKW.js +23 -0
- package/lib/chunk-NBR3QGKW.js.map +1 -0
- package/lib/{chunk-U3DJ354I.mjs → chunk-NFD7D5GZ.mjs} +25 -19
- package/lib/chunk-NFD7D5GZ.mjs.map +1 -0
- package/lib/chunk-NOJB5GBZ.mjs +18 -0
- package/lib/chunk-NOJB5GBZ.mjs.map +1 -0
- package/lib/chunk-NS4GXUCA.mjs +18 -0
- package/lib/chunk-NS4GXUCA.mjs.map +1 -0
- package/lib/chunk-NY2TPU6O.mjs +18 -0
- package/lib/chunk-NY2TPU6O.mjs.map +1 -0
- package/lib/{chunk-QWPHP26D.mjs → chunk-OE3L7EKN.mjs} +2 -2
- package/lib/chunk-OE3L7EKN.mjs.map +1 -0
- package/lib/chunk-OFZMO7PB.mjs +18 -0
- package/lib/chunk-OFZMO7PB.mjs.map +1 -0
- package/lib/chunk-OHUOBIHX.mjs +52 -0
- package/lib/chunk-OHUOBIHX.mjs.map +1 -0
- package/lib/chunk-OMSHZITC.js +20 -0
- package/lib/chunk-OMSHZITC.js.map +1 -0
- package/lib/chunk-OQYS7JVF.js +28 -0
- package/lib/chunk-OQYS7JVF.js.map +1 -0
- package/lib/chunk-OSFIPFQ3.mjs +28 -0
- package/lib/chunk-OSFIPFQ3.mjs.map +1 -0
- package/lib/chunk-OU5BTUDV.mjs +23 -0
- package/lib/chunk-OU5BTUDV.mjs.map +1 -0
- package/lib/chunk-OZ3BTSSQ.mjs +64 -0
- package/lib/chunk-OZ3BTSSQ.mjs.map +1 -0
- package/lib/{chunk-32MKEBKR.js → chunk-PAV4SQQL.js} +3 -3
- package/lib/chunk-PAV4SQQL.js.map +1 -0
- package/lib/chunk-PNSDUVRE.mjs +21 -0
- package/lib/chunk-PNSDUVRE.mjs.map +1 -0
- package/lib/chunk-PVQALO2H.js +23 -0
- package/lib/chunk-PVQALO2H.js.map +1 -0
- package/lib/chunk-QEG24G7E.mjs +18 -0
- package/lib/chunk-QEG24G7E.mjs.map +1 -0
- package/lib/chunk-QIFA6S5U.mjs +18 -0
- package/lib/chunk-QIFA6S5U.mjs.map +1 -0
- package/lib/chunk-QIPGUTIG.mjs +302 -0
- package/lib/chunk-QIPGUTIG.mjs.map +1 -0
- package/lib/chunk-QMIH3A4D.js +18 -0
- package/lib/chunk-QMIH3A4D.js.map +1 -0
- package/lib/chunk-R25HSJPH.js +21 -0
- package/lib/chunk-R25HSJPH.js.map +1 -0
- package/lib/chunk-S4FWDTEW.mjs +20 -0
- package/lib/chunk-S4FWDTEW.mjs.map +1 -0
- package/lib/chunk-S5D5AFDF.js +18 -0
- package/lib/chunk-S5D5AFDF.js.map +1 -0
- package/lib/chunk-SBO6OQIX.mjs +23 -0
- package/lib/chunk-SBO6OQIX.mjs.map +1 -0
- package/lib/chunk-SFIX77W5.js +21 -0
- package/lib/chunk-SFIX77W5.js.map +1 -0
- package/lib/chunk-T2A3XXQZ.mjs +18 -0
- package/lib/chunk-T2A3XXQZ.mjs.map +1 -0
- package/lib/{chunk-P4Q22AZA.js → chunk-TCDQA2NU.js} +12 -9
- package/lib/chunk-TCDQA2NU.js.map +1 -0
- package/lib/{chunk-YSCVE4PJ.mjs → chunk-THU5VBSO.mjs} +2 -2
- package/lib/chunk-THU5VBSO.mjs.map +1 -0
- package/lib/{chunk-EXVTHIT5.js → chunk-TJQ5NVL4.js} +2 -2
- package/lib/chunk-TJQ5NVL4.js.map +1 -0
- package/lib/{chunk-UTPG4GZB.js → chunk-TLPVFRWR.js} +3 -3
- package/lib/chunk-TLPVFRWR.js.map +1 -0
- package/lib/chunk-TLRVQWCI.mjs +30 -0
- package/lib/chunk-TLRVQWCI.mjs.map +1 -0
- package/lib/chunk-TQDMUHTA.mjs +20 -0
- package/lib/chunk-TQDMUHTA.mjs.map +1 -0
- package/lib/chunk-TZBAW5OO.mjs +21 -0
- package/lib/chunk-TZBAW5OO.mjs.map +1 -0
- package/lib/chunk-UHMICS34.mjs +18 -0
- package/lib/chunk-UHMICS34.mjs.map +1 -0
- package/lib/chunk-UYQFYQQG.mjs +69 -0
- package/lib/chunk-UYQFYQQG.mjs.map +1 -0
- package/lib/chunk-V2J4TQR5.mjs +20 -0
- package/lib/chunk-V2J4TQR5.mjs.map +1 -0
- package/lib/chunk-V7C77FML.mjs +18 -0
- package/lib/chunk-V7C77FML.mjs.map +1 -0
- package/lib/chunk-VN4GLOEN.js +302 -0
- package/lib/chunk-VN4GLOEN.js.map +1 -0
- package/lib/chunk-VOFKYSJD.js +20 -0
- package/lib/chunk-VOFKYSJD.js.map +1 -0
- package/lib/chunk-VVXKATDH.js +18 -0
- package/lib/chunk-VVXKATDH.js.map +1 -0
- package/lib/{chunk-P54CF5QN.mjs → chunk-W3U7RYLP.mjs} +2 -2
- package/lib/chunk-W3U7RYLP.mjs.map +1 -0
- package/lib/chunk-WJGXVKZY.js +21 -0
- package/lib/chunk-WJGXVKZY.js.map +1 -0
- package/lib/chunk-WLPDAJB3.js +52 -0
- package/lib/chunk-WLPDAJB3.js.map +1 -0
- package/lib/chunk-WYM2TIVW.mjs +23 -0
- package/lib/chunk-WYM2TIVW.mjs.map +1 -0
- package/lib/chunk-XBE75VFX.js +13 -0
- package/lib/chunk-XBE75VFX.js.map +1 -0
- package/lib/chunk-XDVSL5B6.js +14 -0
- package/lib/chunk-XDVSL5B6.js.map +1 -0
- package/lib/chunk-XIOV4SHZ.mjs +13 -0
- package/lib/chunk-XIOV4SHZ.mjs.map +1 -0
- package/lib/chunk-Y54K6TQO.js +19 -0
- package/lib/chunk-Y54K6TQO.js.map +1 -0
- package/lib/chunk-Y5MNJGFX.js +30 -0
- package/lib/chunk-Y5MNJGFX.js.map +1 -0
- package/lib/chunk-YDTQASAY.mjs +18 -0
- package/lib/chunk-YDTQASAY.mjs.map +1 -0
- package/lib/chunk-YMPRYKNY.js +18 -0
- package/lib/chunk-YMPRYKNY.js.map +1 -0
- package/lib/chunk-Z2HZXSDA.js +18 -0
- package/lib/chunk-Z2HZXSDA.js.map +1 -0
- package/lib/chunk-Z3NPFUIA.mjs +18 -0
- package/lib/chunk-Z3NPFUIA.mjs.map +1 -0
- package/lib/chunk-Z4XOKGU3.js +71 -0
- package/lib/chunk-Z4XOKGU3.js.map +1 -0
- package/lib/chunk-ZDXO3TGZ.mjs +18 -0
- package/lib/chunk-ZDXO3TGZ.mjs.map +1 -0
- package/lib/chunk-ZEGRYDE5.mjs +18 -0
- package/lib/chunk-ZEGRYDE5.mjs.map +1 -0
- package/lib/chunk-ZGUF5ZDP.mjs +21 -0
- package/lib/chunk-ZGUF5ZDP.mjs.map +1 -0
- package/lib/chunk-ZNQHNLKW.js +18 -0
- package/lib/chunk-ZNQHNLKW.js.map +1 -0
- package/lib/codeGen.d.mts +2 -2
- package/lib/codeGen.d.ts +2 -2
- package/lib/codeGen.js +3 -45
- package/lib/codeGen.js.map +1 -1
- package/lib/codeGen.mjs +4 -46
- package/lib/codeGen.mjs.map +1 -1
- package/lib/commonTypes.d.mts +12 -1
- package/lib/commonTypes.d.ts +12 -1
- package/lib/core.d.mts +200 -0
- package/lib/core.d.ts +200 -0
- package/lib/core.js +17 -0
- package/lib/core.js.map +1 -0
- package/lib/core.mjs +17 -0
- package/lib/helpers/constants.d.mts +2 -1
- package/lib/helpers/constants.d.ts +2 -1
- package/lib/helpers/constants.js +4 -2
- package/lib/helpers/constants.js.map +1 -1
- package/lib/helpers/constants.mjs +5 -3
- package/lib/helpers/setStrictType.d.mts +2 -2
- package/lib/helpers/setStrictType.d.ts +2 -2
- package/lib/helpers/setStrictType.js +3 -4
- package/lib/helpers/setStrictType.js.map +1 -1
- package/lib/helpers/setStrictType.mjs +2 -3
- package/lib/index.d.mts +51 -4
- package/lib/index.d.ts +51 -4
- package/lib/index.js +205 -4
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +206 -5
- package/lib/translationMap.d.mts +3 -1
- package/lib/translationMap.d.ts +3 -1
- package/lib/translationMap.js +2 -2
- package/lib/translationMap.mjs +1 -1
- package/package.json +46 -41
- package/lib/CommonSchema-BIfYCtcQ.d.mts +0 -110
- package/lib/CommonSchema-DIDMH9R7.d.ts +0 -110
- package/lib/ExceptionContext.d.mts +0 -16
- package/lib/ExceptionContext.d.ts +0 -16
- package/lib/ExceptionContext.js +0 -11
- package/lib/ExceptionContext.js.map +0 -1
- package/lib/ExceptionContext.mjs +0 -11
- package/lib/ExceptionContext.mjs.map +0 -1
- package/lib/chunk-32MKEBKR.js.map +0 -1
- package/lib/chunk-3ZQ4ORQH.js +0 -14
- package/lib/chunk-3ZQ4ORQH.js.map +0 -1
- package/lib/chunk-42J6CHIO.js.map +0 -1
- package/lib/chunk-BURPSYZ3.js.map +0 -1
- package/lib/chunk-CCNK27CX.mjs.map +0 -1
- package/lib/chunk-EMOOEIPZ.mjs.map +0 -1
- package/lib/chunk-EXVTHIT5.js.map +0 -1
- package/lib/chunk-FNBYM254.js +0 -41
- package/lib/chunk-FNBYM254.js.map +0 -1
- package/lib/chunk-IFQLPXCZ.mjs +0 -111
- package/lib/chunk-IFQLPXCZ.mjs.map +0 -1
- package/lib/chunk-MMWS3SXR.js +0 -136
- package/lib/chunk-MMWS3SXR.js.map +0 -1
- package/lib/chunk-MQRXWXHP.mjs +0 -83
- package/lib/chunk-MQRXWXHP.mjs.map +0 -1
- package/lib/chunk-MRRMV2GM.mjs +0 -63
- package/lib/chunk-MRRMV2GM.mjs.map +0 -1
- package/lib/chunk-P4Q22AZA.js.map +0 -1
- package/lib/chunk-P54CF5QN.mjs.map +0 -1
- package/lib/chunk-PE55R4KH.js +0 -83
- package/lib/chunk-PE55R4KH.js.map +0 -1
- package/lib/chunk-PGEXAFA5.js +0 -20
- package/lib/chunk-PGEXAFA5.js.map +0 -1
- package/lib/chunk-PQ4GCO3Q.js +0 -111
- package/lib/chunk-PQ4GCO3Q.js.map +0 -1
- package/lib/chunk-QWPHP26D.mjs.map +0 -1
- package/lib/chunk-RAJF6LMF.js +0 -63
- package/lib/chunk-RAJF6LMF.js.map +0 -1
- package/lib/chunk-RG5NYH2I.js +0 -65
- package/lib/chunk-RG5NYH2I.js.map +0 -1
- package/lib/chunk-U3DJ354I.mjs.map +0 -1
- package/lib/chunk-UEYMBPZN.mjs +0 -136
- package/lib/chunk-UEYMBPZN.mjs.map +0 -1
- package/lib/chunk-UTPG4GZB.js.map +0 -1
- package/lib/chunk-VIFJBTQO.mjs +0 -20
- package/lib/chunk-VIFJBTQO.mjs.map +0 -1
- package/lib/chunk-W2SQHSOS.mjs +0 -58
- package/lib/chunk-W2SQHSOS.mjs.map +0 -1
- package/lib/chunk-XG6K6N3A.mjs.map +0 -1
- package/lib/chunk-XT5E3MPI.mjs +0 -41
- package/lib/chunk-XT5E3MPI.mjs.map +0 -1
- package/lib/chunk-YSCVE4PJ.mjs.map +0 -1
- package/lib/chunk-ZG373PNB.js +0 -58
- package/lib/chunk-ZG373PNB.js.map +0 -1
- package/lib/helpers/core.d.mts +0 -4
- package/lib/helpers/core.d.ts +0 -4
- package/lib/helpers/core.js +0 -10
- package/lib/helpers/core.js.map +0 -1
- package/lib/helpers/core.mjs +0 -10
- package/lib/parse.d.mts +0 -62
- package/lib/parse.d.ts +0 -62
- package/lib/parse.js +0 -11
- package/lib/parse.js.map +0 -1
- package/lib/parse.mjs +0 -11
- package/lib/parse.mjs.map +0 -1
- package/lib/parseOrFail.d.mts +0 -44
- package/lib/parseOrFail.d.ts +0 -44
- package/lib/parseOrFail.js +0 -11
- package/lib/parseOrFail.js.map +0 -1
- package/lib/parseOrFail.mjs +0 -11
- package/lib/parseOrFail.mjs.map +0 -1
- package/lib/schemas/ArraySchema.d.mts +0 -12
- package/lib/schemas/ArraySchema.d.ts +0 -12
- package/lib/schemas/ArraySchema.js +0 -13
- package/lib/schemas/ArraySchema.js.map +0 -1
- package/lib/schemas/ArraySchema.mjs +0 -13
- package/lib/schemas/ArraySchema.mjs.map +0 -1
- package/lib/schemas/BigIntSchema.d.mts +0 -31
- package/lib/schemas/BigIntSchema.d.ts +0 -31
- package/lib/schemas/BigIntSchema.js +0 -17
- package/lib/schemas/BigIntSchema.js.map +0 -1
- package/lib/schemas/BigIntSchema.mjs +0 -17
- package/lib/schemas/BigIntSchema.mjs.map +0 -1
- package/lib/schemas/BooleanSchema.d.mts +0 -26
- package/lib/schemas/BooleanSchema.d.ts +0 -26
- package/lib/schemas/BooleanSchema.js +0 -14
- package/lib/schemas/BooleanSchema.js.map +0 -1
- package/lib/schemas/BooleanSchema.mjs +0 -14
- package/lib/schemas/BooleanSchema.mjs.map +0 -1
- package/lib/schemas/CommonSchema.d.mts +0 -4
- package/lib/schemas/CommonSchema.d.ts +0 -4
- package/lib/schemas/CommonSchema.js +0 -12
- package/lib/schemas/CommonSchema.js.map +0 -1
- package/lib/schemas/CommonSchema.mjs +0 -12
- package/lib/schemas/CommonSchema.mjs.map +0 -1
- package/lib/schemas/DateSchema.d.mts +0 -11
- package/lib/schemas/DateSchema.d.ts +0 -11
- package/lib/schemas/DateSchema.js +0 -13
- package/lib/schemas/DateSchema.js.map +0 -1
- package/lib/schemas/DateSchema.mjs +0 -13
- package/lib/schemas/DateSchema.mjs.map +0 -1
- package/lib/schemas/NumberSchema.d.mts +0 -30
- package/lib/schemas/NumberSchema.d.ts +0 -30
- package/lib/schemas/NumberSchema.js +0 -17
- package/lib/schemas/NumberSchema.js.map +0 -1
- package/lib/schemas/NumberSchema.mjs +0 -17
- package/lib/schemas/NumberSchema.mjs.map +0 -1
- package/lib/schemas/ObjectSchema.d.mts +0 -30
- package/lib/schemas/ObjectSchema.d.ts +0 -30
- package/lib/schemas/ObjectSchema.js +0 -13
- package/lib/schemas/ObjectSchema.js.map +0 -1
- package/lib/schemas/ObjectSchema.mjs +0 -13
- package/lib/schemas/ObjectSchema.mjs.map +0 -1
- package/lib/schemas/StringSchema.d.mts +0 -31
- package/lib/schemas/StringSchema.d.ts +0 -31
- package/lib/schemas/StringSchema.js +0 -17
- package/lib/schemas/StringSchema.js.map +0 -1
- package/lib/schemas/StringSchema.mjs +0 -17
- package/lib/schemas/StringSchema.mjs.map +0 -1
- /package/lib/{helpers/core.mjs.map → core.mjs.map} +0 -0
package/lib/core.d.mts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { BaseType, TranslationErrorMap, ValidationErrorData, MetaContext, TransformCallback, WithNull, WithUndefined } from './commonTypes.mjs';
|
|
2
|
+
import { InferType } from './InferType.mjs';
|
|
3
|
+
import { ctxSymbol } from './helpers/constants.mjs';
|
|
4
|
+
|
|
5
|
+
declare class ExceptionContext {
|
|
6
|
+
readonly initialReceived: unknown;
|
|
7
|
+
readonly t: TranslationErrorMap;
|
|
8
|
+
readonly pathToError: string;
|
|
9
|
+
readonly errors?: ValidationErrorData[] | undefined;
|
|
10
|
+
readonly meta?: MetaContext | undefined;
|
|
11
|
+
constructor(initialReceived: unknown, t: TranslationErrorMap, pathToError: string, errors?: ValidationErrorData[] | undefined, meta?: MetaContext | undefined);
|
|
12
|
+
createChild(childPathToError: string, childMeta?: MetaContext): ExceptionContext;
|
|
13
|
+
ref(path: string): unknown;
|
|
14
|
+
addIssue(expected: unknown, received: unknown, messageKey: string): never | void;
|
|
15
|
+
}
|
|
16
|
+
type RequiredValidation = (received: any, ctx: ExceptionContext) => void;
|
|
17
|
+
type ObjectShapeSchemaType = Record<string, CommonSchema>;
|
|
18
|
+
interface ValidatorContext {
|
|
19
|
+
type: BaseType[];
|
|
20
|
+
isNullable?: boolean;
|
|
21
|
+
isOptional?: boolean;
|
|
22
|
+
requiredValidations: RequiredValidation[];
|
|
23
|
+
array?: CommonSchema;
|
|
24
|
+
object?: ObjectShapeSchemaType;
|
|
25
|
+
allowUnrecognizedObjectProps?: boolean;
|
|
26
|
+
strictType?: boolean;
|
|
27
|
+
strictTypeValue?: unknown;
|
|
28
|
+
date?: boolean;
|
|
29
|
+
defaultValue?: unknown;
|
|
30
|
+
meta?: MetaContext;
|
|
31
|
+
transformListBefore?: TransformCallback<any, any>[];
|
|
32
|
+
}
|
|
33
|
+
declare class CommonSchema {
|
|
34
|
+
[ctxSymbol]: ValidatorContext;
|
|
35
|
+
constructor(ctx: ValidatorContext);
|
|
36
|
+
/**
|
|
37
|
+
* @param validators - One or more custom validation functions.
|
|
38
|
+
* @returns {this} The schema instance with the added custom validation.
|
|
39
|
+
*/
|
|
40
|
+
custom(...validators: RequiredValidation[]): this;
|
|
41
|
+
/**
|
|
42
|
+
* Marks the schema as nullable, allowing the value to be `null`.
|
|
43
|
+
*
|
|
44
|
+
* @returns {WithNull<this>} The schema instance marked as nullable.
|
|
45
|
+
*/
|
|
46
|
+
nullable(): WithNull<this>;
|
|
47
|
+
/**
|
|
48
|
+
* Marks the schema as optional, allowing the value to be `undefined`.
|
|
49
|
+
*
|
|
50
|
+
* @returns {WithUndefined<this>} The schema instance marked as optional.
|
|
51
|
+
*/
|
|
52
|
+
optional(): WithUndefined<this>;
|
|
53
|
+
/**
|
|
54
|
+
* Marks the schema as optional, allowing the value to be `undefined`.
|
|
55
|
+
*
|
|
56
|
+
* @returns {this} The schema instance. This method should be used as a last one because it does the check of previous methods and
|
|
57
|
+
*/
|
|
58
|
+
default(defaultValue: InferType<this>): this;
|
|
59
|
+
/**
|
|
60
|
+
* Applies a transformation to the input value before any validation occurs.
|
|
61
|
+
* The transformation should return a value of the same type as the inferred type of the schema,
|
|
62
|
+
* ensuring that the overall type is not altered.
|
|
63
|
+
*
|
|
64
|
+
* @template In - The type of the input value before transformation (defaults to `unknown`).
|
|
65
|
+
* @param {TransformCallback<In, InferType<this>>} cb - The callback function that performs the transformation.
|
|
66
|
+
* @returns {this} The updated schema with the applied transformation.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* const schema = string()
|
|
70
|
+
* .nullable()
|
|
71
|
+
* .transformBeforeValidation((val) => val + '') // Ensure the value is a string
|
|
72
|
+
* .transformBeforeValidation((val: string) => (val === '' ? null : val)); // Convert empty strings to null
|
|
73
|
+
*
|
|
74
|
+
* // Parse 'test' will pass as 'test' is a valid string longer than 3 characters.
|
|
75
|
+
* parseOrFail(schema, 'test');
|
|
76
|
+
*
|
|
77
|
+
* // Parsing '' will be transformed to null and will pass due to .nullable().
|
|
78
|
+
* parseOrFail(schema, '');
|
|
79
|
+
*/
|
|
80
|
+
transformBeforeValidation<In>(cb: TransformCallback<In, InferType<this>>): this;
|
|
81
|
+
/**
|
|
82
|
+
* Assigns a unique identifier to the schema.
|
|
83
|
+
* This ID can be used to track or map validation errors back to specific fields
|
|
84
|
+
* in a form or other structures.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} value - The unique identifier for the schema.
|
|
87
|
+
* @returns {this} The updated schema with the assigned ID.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const schema = string().id('username');
|
|
91
|
+
*/
|
|
92
|
+
id(value: string): this;
|
|
93
|
+
/**
|
|
94
|
+
* Provides a description for the schema, offering additional context or information.
|
|
95
|
+
* The description can be used when displaying validation errors or for documentation purposes.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} value - The description for the schema.
|
|
98
|
+
* @returns {this} The updated schema with the added description.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const schema = string().description('The username of the account holder.');
|
|
102
|
+
*/
|
|
103
|
+
description(value: string): this;
|
|
104
|
+
private meta;
|
|
105
|
+
protected defaultValueCheck(): void;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Parses and validates a value against the provided schema, returning a type-safe result.
|
|
109
|
+
*
|
|
110
|
+
* This function will throw a `ValidationError` if the value does not conform to the schema.
|
|
111
|
+
* The inferred TypeScript type of the returned value will match the structure defined by the schema.
|
|
112
|
+
*
|
|
113
|
+
* @template T
|
|
114
|
+
* @param {T} schema - The schema to validate the received value against. This schema dictates the expected structure and type of the value.
|
|
115
|
+
* @param {unknown} receivedValue - The value to be validated and parsed according to the schema.
|
|
116
|
+
* @param {ParseOptions} options - Options
|
|
117
|
+
* @param {ParseOptions.lng} options.lng - Set language keyword to map Error message
|
|
118
|
+
* @returns {InferType<T>} The validated value, with its TypeScript type inferred from the schema.
|
|
119
|
+
*
|
|
120
|
+
* @throws {ValidationError} If the received value does not match the schema, a `ValidationError` will be thrown.
|
|
121
|
+
* @throws {Error} If an unexpected error occurs during validation, an error will be thrown with a generic message.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* const schema = object({
|
|
125
|
+
* name: string(),
|
|
126
|
+
* age: number(),
|
|
127
|
+
* });
|
|
128
|
+
*
|
|
129
|
+
* const result = parseOrFail(schema, { name: 'Alice', age: 30 });
|
|
130
|
+
* // result will be inferred as { name: string; age: number }
|
|
131
|
+
*
|
|
132
|
+
* parseOrFail(schema, { name: 'Alice', age: '30' });
|
|
133
|
+
* // Throws ValidationError because 'age' should be a number, not a string.
|
|
134
|
+
*/
|
|
135
|
+
declare function parseOrFail<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): InferType<T>;
|
|
136
|
+
interface ParseOptions {
|
|
137
|
+
/**
|
|
138
|
+
* Set language keyword to map error messages.
|
|
139
|
+
* @default 'default'
|
|
140
|
+
* @example 'sr' or 'Serbia' or any string to identify language
|
|
141
|
+
*/
|
|
142
|
+
lng?: string;
|
|
143
|
+
}
|
|
144
|
+
interface ParseOptions {
|
|
145
|
+
/**
|
|
146
|
+
* Set language keyword to map error messages.
|
|
147
|
+
* @default 'default'
|
|
148
|
+
* @example 'sr' or 'Serbia' or any string to identify language
|
|
149
|
+
*/
|
|
150
|
+
lng?: string;
|
|
151
|
+
/**
|
|
152
|
+
* If true, collects all validation errors and returns them.
|
|
153
|
+
* If false or undefined, returns the first validation error it can find and stops looking,
|
|
154
|
+
* which provides a small runtime optimization.
|
|
155
|
+
* @default undefined
|
|
156
|
+
*/
|
|
157
|
+
getAllErrors?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Parses and validates a value against the provided schema, returning a type-safe parsedValue.
|
|
161
|
+
*
|
|
162
|
+
* This function will throw a `ValidationError` if the value does not conform to the schema.
|
|
163
|
+
* The inferred TypeScript type of the returned value will match the structure defined by the schema.
|
|
164
|
+
*
|
|
165
|
+
* @template T
|
|
166
|
+
* @param {T} schema - The schema to validate the received value against. This schema dictates the expected structure and type of the value.
|
|
167
|
+
* @param {unknown} receivedValue - The value to be validated and parsed according to the schema.
|
|
168
|
+
* @param {ParseOptions} options - Options
|
|
169
|
+
* @param {ParseOptions.lng} options.lng - Set language keyword to map Error messages
|
|
170
|
+
* @param {ParseOptions.lng} options.getAllErrors - If `false` or `undefined` - returns the first validation error it can find and stops looking, which provides a small runtime optimization.
|
|
171
|
+
* @returns {[undefined, InferType<T>]} A tuple of [undefined, InferType<T>] if parsing is successful.
|
|
172
|
+
* @returns {[ValidationErrorData[], undefined]} A tuple of [ValidationErrorData[], undefined]] if errors occur.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* const schema = object({
|
|
176
|
+
* name: string(),
|
|
177
|
+
* age: number(),
|
|
178
|
+
* });
|
|
179
|
+
*
|
|
180
|
+
* const [errors, parsedValue] = parse(schema, { name: 'Alice', age: 30 });
|
|
181
|
+
* // parsedValue will be inferred as { name: string; age: number }
|
|
182
|
+
*
|
|
183
|
+
*
|
|
184
|
+
* const [errors, parsedValue] = parse(schema, { name: 'Alice', age: '30' });
|
|
185
|
+
* // First element in array "errors" will have an error because 'age' should be a number, not a string.
|
|
186
|
+
* // Array 'errors' returns only one element.
|
|
187
|
+
*
|
|
188
|
+
*
|
|
189
|
+
* const [errors, parsedValue] = parse(schema, { name: true, age: '30' }, { getAllErrors: true});
|
|
190
|
+
* // Returns array "errors" with multiple errors because 'age' should be a number and 'name' a string.
|
|
191
|
+
* // With provided options { getAllErrors: true}, we can expecte more than one error in 'errors' array.
|
|
192
|
+
*
|
|
193
|
+
*
|
|
194
|
+
* const [errors, parsedValue] = parse(schema, { name: true, age: '30' }, { lng: 'SR'});
|
|
195
|
+
* // First element in array "errors" will have an error because 'age' should be a number, not a string.
|
|
196
|
+
* // With provided options { lng: 'SR'}, errors will be translated to a language mapped with keyword 'SR'
|
|
197
|
+
*/
|
|
198
|
+
declare function parse<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): [ValidationErrorData[], undefined] | [undefined, InferType<T>];
|
|
199
|
+
|
|
200
|
+
export { CommonSchema, ExceptionContext, type ObjectShapeSchemaType, type RequiredValidation, type ValidatorContext, parse, parseOrFail };
|
package/lib/core.d.ts
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { BaseType, TranslationErrorMap, ValidationErrorData, MetaContext, TransformCallback, WithNull, WithUndefined } from './commonTypes.js';
|
|
2
|
+
import { InferType } from './InferType.js';
|
|
3
|
+
import { ctxSymbol } from './helpers/constants.js';
|
|
4
|
+
|
|
5
|
+
declare class ExceptionContext {
|
|
6
|
+
readonly initialReceived: unknown;
|
|
7
|
+
readonly t: TranslationErrorMap;
|
|
8
|
+
readonly pathToError: string;
|
|
9
|
+
readonly errors?: ValidationErrorData[] | undefined;
|
|
10
|
+
readonly meta?: MetaContext | undefined;
|
|
11
|
+
constructor(initialReceived: unknown, t: TranslationErrorMap, pathToError: string, errors?: ValidationErrorData[] | undefined, meta?: MetaContext | undefined);
|
|
12
|
+
createChild(childPathToError: string, childMeta?: MetaContext): ExceptionContext;
|
|
13
|
+
ref(path: string): unknown;
|
|
14
|
+
addIssue(expected: unknown, received: unknown, messageKey: string): never | void;
|
|
15
|
+
}
|
|
16
|
+
type RequiredValidation = (received: any, ctx: ExceptionContext) => void;
|
|
17
|
+
type ObjectShapeSchemaType = Record<string, CommonSchema>;
|
|
18
|
+
interface ValidatorContext {
|
|
19
|
+
type: BaseType[];
|
|
20
|
+
isNullable?: boolean;
|
|
21
|
+
isOptional?: boolean;
|
|
22
|
+
requiredValidations: RequiredValidation[];
|
|
23
|
+
array?: CommonSchema;
|
|
24
|
+
object?: ObjectShapeSchemaType;
|
|
25
|
+
allowUnrecognizedObjectProps?: boolean;
|
|
26
|
+
strictType?: boolean;
|
|
27
|
+
strictTypeValue?: unknown;
|
|
28
|
+
date?: boolean;
|
|
29
|
+
defaultValue?: unknown;
|
|
30
|
+
meta?: MetaContext;
|
|
31
|
+
transformListBefore?: TransformCallback<any, any>[];
|
|
32
|
+
}
|
|
33
|
+
declare class CommonSchema {
|
|
34
|
+
[ctxSymbol]: ValidatorContext;
|
|
35
|
+
constructor(ctx: ValidatorContext);
|
|
36
|
+
/**
|
|
37
|
+
* @param validators - One or more custom validation functions.
|
|
38
|
+
* @returns {this} The schema instance with the added custom validation.
|
|
39
|
+
*/
|
|
40
|
+
custom(...validators: RequiredValidation[]): this;
|
|
41
|
+
/**
|
|
42
|
+
* Marks the schema as nullable, allowing the value to be `null`.
|
|
43
|
+
*
|
|
44
|
+
* @returns {WithNull<this>} The schema instance marked as nullable.
|
|
45
|
+
*/
|
|
46
|
+
nullable(): WithNull<this>;
|
|
47
|
+
/**
|
|
48
|
+
* Marks the schema as optional, allowing the value to be `undefined`.
|
|
49
|
+
*
|
|
50
|
+
* @returns {WithUndefined<this>} The schema instance marked as optional.
|
|
51
|
+
*/
|
|
52
|
+
optional(): WithUndefined<this>;
|
|
53
|
+
/**
|
|
54
|
+
* Marks the schema as optional, allowing the value to be `undefined`.
|
|
55
|
+
*
|
|
56
|
+
* @returns {this} The schema instance. This method should be used as a last one because it does the check of previous methods and
|
|
57
|
+
*/
|
|
58
|
+
default(defaultValue: InferType<this>): this;
|
|
59
|
+
/**
|
|
60
|
+
* Applies a transformation to the input value before any validation occurs.
|
|
61
|
+
* The transformation should return a value of the same type as the inferred type of the schema,
|
|
62
|
+
* ensuring that the overall type is not altered.
|
|
63
|
+
*
|
|
64
|
+
* @template In - The type of the input value before transformation (defaults to `unknown`).
|
|
65
|
+
* @param {TransformCallback<In, InferType<this>>} cb - The callback function that performs the transformation.
|
|
66
|
+
* @returns {this} The updated schema with the applied transformation.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* const schema = string()
|
|
70
|
+
* .nullable()
|
|
71
|
+
* .transformBeforeValidation((val) => val + '') // Ensure the value is a string
|
|
72
|
+
* .transformBeforeValidation((val: string) => (val === '' ? null : val)); // Convert empty strings to null
|
|
73
|
+
*
|
|
74
|
+
* // Parse 'test' will pass as 'test' is a valid string longer than 3 characters.
|
|
75
|
+
* parseOrFail(schema, 'test');
|
|
76
|
+
*
|
|
77
|
+
* // Parsing '' will be transformed to null and will pass due to .nullable().
|
|
78
|
+
* parseOrFail(schema, '');
|
|
79
|
+
*/
|
|
80
|
+
transformBeforeValidation<In>(cb: TransformCallback<In, InferType<this>>): this;
|
|
81
|
+
/**
|
|
82
|
+
* Assigns a unique identifier to the schema.
|
|
83
|
+
* This ID can be used to track or map validation errors back to specific fields
|
|
84
|
+
* in a form or other structures.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} value - The unique identifier for the schema.
|
|
87
|
+
* @returns {this} The updated schema with the assigned ID.
|
|
88
|
+
*
|
|
89
|
+
* @example
|
|
90
|
+
* const schema = string().id('username');
|
|
91
|
+
*/
|
|
92
|
+
id(value: string): this;
|
|
93
|
+
/**
|
|
94
|
+
* Provides a description for the schema, offering additional context or information.
|
|
95
|
+
* The description can be used when displaying validation errors or for documentation purposes.
|
|
96
|
+
*
|
|
97
|
+
* @param {string} value - The description for the schema.
|
|
98
|
+
* @returns {this} The updated schema with the added description.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* const schema = string().description('The username of the account holder.');
|
|
102
|
+
*/
|
|
103
|
+
description(value: string): this;
|
|
104
|
+
private meta;
|
|
105
|
+
protected defaultValueCheck(): void;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Parses and validates a value against the provided schema, returning a type-safe result.
|
|
109
|
+
*
|
|
110
|
+
* This function will throw a `ValidationError` if the value does not conform to the schema.
|
|
111
|
+
* The inferred TypeScript type of the returned value will match the structure defined by the schema.
|
|
112
|
+
*
|
|
113
|
+
* @template T
|
|
114
|
+
* @param {T} schema - The schema to validate the received value against. This schema dictates the expected structure and type of the value.
|
|
115
|
+
* @param {unknown} receivedValue - The value to be validated and parsed according to the schema.
|
|
116
|
+
* @param {ParseOptions} options - Options
|
|
117
|
+
* @param {ParseOptions.lng} options.lng - Set language keyword to map Error message
|
|
118
|
+
* @returns {InferType<T>} The validated value, with its TypeScript type inferred from the schema.
|
|
119
|
+
*
|
|
120
|
+
* @throws {ValidationError} If the received value does not match the schema, a `ValidationError` will be thrown.
|
|
121
|
+
* @throws {Error} If an unexpected error occurs during validation, an error will be thrown with a generic message.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* const schema = object({
|
|
125
|
+
* name: string(),
|
|
126
|
+
* age: number(),
|
|
127
|
+
* });
|
|
128
|
+
*
|
|
129
|
+
* const result = parseOrFail(schema, { name: 'Alice', age: 30 });
|
|
130
|
+
* // result will be inferred as { name: string; age: number }
|
|
131
|
+
*
|
|
132
|
+
* parseOrFail(schema, { name: 'Alice', age: '30' });
|
|
133
|
+
* // Throws ValidationError because 'age' should be a number, not a string.
|
|
134
|
+
*/
|
|
135
|
+
declare function parseOrFail<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): InferType<T>;
|
|
136
|
+
interface ParseOptions {
|
|
137
|
+
/**
|
|
138
|
+
* Set language keyword to map error messages.
|
|
139
|
+
* @default 'default'
|
|
140
|
+
* @example 'sr' or 'Serbia' or any string to identify language
|
|
141
|
+
*/
|
|
142
|
+
lng?: string;
|
|
143
|
+
}
|
|
144
|
+
interface ParseOptions {
|
|
145
|
+
/**
|
|
146
|
+
* Set language keyword to map error messages.
|
|
147
|
+
* @default 'default'
|
|
148
|
+
* @example 'sr' or 'Serbia' or any string to identify language
|
|
149
|
+
*/
|
|
150
|
+
lng?: string;
|
|
151
|
+
/**
|
|
152
|
+
* If true, collects all validation errors and returns them.
|
|
153
|
+
* If false or undefined, returns the first validation error it can find and stops looking,
|
|
154
|
+
* which provides a small runtime optimization.
|
|
155
|
+
* @default undefined
|
|
156
|
+
*/
|
|
157
|
+
getAllErrors?: boolean;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Parses and validates a value against the provided schema, returning a type-safe parsedValue.
|
|
161
|
+
*
|
|
162
|
+
* This function will throw a `ValidationError` if the value does not conform to the schema.
|
|
163
|
+
* The inferred TypeScript type of the returned value will match the structure defined by the schema.
|
|
164
|
+
*
|
|
165
|
+
* @template T
|
|
166
|
+
* @param {T} schema - The schema to validate the received value against. This schema dictates the expected structure and type of the value.
|
|
167
|
+
* @param {unknown} receivedValue - The value to be validated and parsed according to the schema.
|
|
168
|
+
* @param {ParseOptions} options - Options
|
|
169
|
+
* @param {ParseOptions.lng} options.lng - Set language keyword to map Error messages
|
|
170
|
+
* @param {ParseOptions.lng} options.getAllErrors - If `false` or `undefined` - returns the first validation error it can find and stops looking, which provides a small runtime optimization.
|
|
171
|
+
* @returns {[undefined, InferType<T>]} A tuple of [undefined, InferType<T>] if parsing is successful.
|
|
172
|
+
* @returns {[ValidationErrorData[], undefined]} A tuple of [ValidationErrorData[], undefined]] if errors occur.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* const schema = object({
|
|
176
|
+
* name: string(),
|
|
177
|
+
* age: number(),
|
|
178
|
+
* });
|
|
179
|
+
*
|
|
180
|
+
* const [errors, parsedValue] = parse(schema, { name: 'Alice', age: 30 });
|
|
181
|
+
* // parsedValue will be inferred as { name: string; age: number }
|
|
182
|
+
*
|
|
183
|
+
*
|
|
184
|
+
* const [errors, parsedValue] = parse(schema, { name: 'Alice', age: '30' });
|
|
185
|
+
* // First element in array "errors" will have an error because 'age' should be a number, not a string.
|
|
186
|
+
* // Array 'errors' returns only one element.
|
|
187
|
+
*
|
|
188
|
+
*
|
|
189
|
+
* const [errors, parsedValue] = parse(schema, { name: true, age: '30' }, { getAllErrors: true});
|
|
190
|
+
* // Returns array "errors" with multiple errors because 'age' should be a number and 'name' a string.
|
|
191
|
+
* // With provided options { getAllErrors: true}, we can expecte more than one error in 'errors' array.
|
|
192
|
+
*
|
|
193
|
+
*
|
|
194
|
+
* const [errors, parsedValue] = parse(schema, { name: true, age: '30' }, { lng: 'SR'});
|
|
195
|
+
* // First element in array "errors" will have an error because 'age' should be a number, not a string.
|
|
196
|
+
* // With provided options { lng: 'SR'}, errors will be translated to a language mapped with keyword 'SR'
|
|
197
|
+
*/
|
|
198
|
+
declare function parse<T extends CommonSchema>(schema: T, receivedValue: unknown, options?: ParseOptions): [ValidationErrorData[], undefined] | [undefined, InferType<T>];
|
|
199
|
+
|
|
200
|
+
export { CommonSchema, ExceptionContext, type ObjectShapeSchemaType, type RequiredValidation, type ValidatorContext, parse, parseOrFail };
|
package/lib/core.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
var _chunkVN4GLOENjs = require('./chunk-VN4GLOEN.js');
|
|
7
|
+
require('./chunk-VBTWYDEM.js');
|
|
8
|
+
require('./chunk-TJQ5NVL4.js');
|
|
9
|
+
require('./chunk-FIDPCCCW.js');
|
|
10
|
+
require('./chunk-AXKX5BGH.js');
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
exports.CommonSchema = _chunkVN4GLOENjs.CommonSchema; exports.ExceptionContext = _chunkVN4GLOENjs.ExceptionContext; exports.parse = _chunkVN4GLOENjs.parse; exports.parseOrFail = _chunkVN4GLOENjs.parseOrFail;
|
|
17
|
+
//# sourceMappingURL=core.js.map
|
package/lib/core.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/core.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACF,sDAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B,+BAA4B;AAC5B;AACE;AACA;AACA;AACA;AACF,+MAAC","file":"/home/runner/work/bguard/bguard/lib/core.js"}
|
package/lib/core.mjs
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CommonSchema,
|
|
3
|
+
ExceptionContext,
|
|
4
|
+
parse,
|
|
5
|
+
parseOrFail
|
|
6
|
+
} from "./chunk-QIPGUTIG.mjs";
|
|
7
|
+
import "./chunk-YBVMP4EI.mjs";
|
|
8
|
+
import "./chunk-OE3L7EKN.mjs";
|
|
9
|
+
import "./chunk-ZTCXXAKD.mjs";
|
|
10
|
+
import "./chunk-2ANPCB4O.mjs";
|
|
11
|
+
export {
|
|
12
|
+
CommonSchema,
|
|
13
|
+
ExceptionContext,
|
|
14
|
+
parse,
|
|
15
|
+
parseOrFail
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=core.mjs.map
|
package/lib/helpers/constants.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunk42J6CHIOjs = require('../chunk-42J6CHIO.js');
|
|
4
3
|
|
|
4
|
+
var _chunkAXKX5BGHjs = require('../chunk-AXKX5BGH.js');
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.ONLY_ONCE = _chunkAXKX5BGHjs.ONLY_ONCE; exports.ctxSymbol = _chunkAXKX5BGHjs.ctxSymbol;
|
|
7
9
|
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/helpers/constants.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,+
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/helpers/constants.js"],"names":[],"mappings":"AAAA;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,+FAAC","file":"/home/runner/work/bguard/bguard/lib/helpers/constants.js"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../ExceptionContext.mjs';
|
|
1
|
+
import { CommonSchema } from '../core.mjs';
|
|
3
2
|
import '../commonTypes.mjs';
|
|
4
3
|
import '../InferType.mjs';
|
|
4
|
+
import './constants.mjs';
|
|
5
5
|
|
|
6
6
|
declare function _setStrictType(that: CommonSchema, val: unknown): void;
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../ExceptionContext.js';
|
|
1
|
+
import { CommonSchema } from '../core.js';
|
|
3
2
|
import '../commonTypes.js';
|
|
4
3
|
import '../InferType.js';
|
|
4
|
+
import './constants.js';
|
|
5
5
|
|
|
6
6
|
declare function _setStrictType(that: CommonSchema, val: unknown): void;
|
|
7
7
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-VBTWYDEM.js');
|
|
3
|
+
var _chunkXDVSL5B6js = require('../chunk-XDVSL5B6.js');
|
|
4
|
+
require('../chunk-AXKX5BGH.js');
|
|
6
5
|
|
|
7
6
|
|
|
8
|
-
exports._setStrictType =
|
|
7
|
+
exports._setStrictType = _chunkXDVSL5B6js._setStrictType;
|
|
9
8
|
//# sourceMappingURL=setStrictType.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/helpers/setStrictType.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B
|
|
1
|
+
{"version":3,"sources":["/home/runner/work/bguard/bguard/lib/helpers/setStrictType.js"],"names":[],"mappings":"AAAA;AACE;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACE;AACF,yDAAC","file":"/home/runner/work/bguard/bguard/lib/helpers/setStrictType.js"}
|
package/lib/index.d.mts
CHANGED
|
@@ -1,8 +1,55 @@
|
|
|
1
1
|
export { InferType } from './InferType.mjs';
|
|
2
|
-
export { parse } from './
|
|
3
|
-
export { parseOrFail } from './parseOrFail.mjs';
|
|
2
|
+
export { ExceptionContext, parse, parseOrFail } from './core.mjs';
|
|
4
3
|
export { BuildSchemaError, ValidationError } from './exceptions.mjs';
|
|
5
4
|
export { clearLocales, setLocale, setToDefaultLocale } from './translationMap.mjs';
|
|
5
|
+
export { codeGen, codeGenWithName } from './codeGen.mjs';
|
|
6
|
+
export { array } from './asserts/array/index.mjs';
|
|
7
|
+
export { maxArrayLength } from './asserts/array/maxArrayLength.mjs';
|
|
8
|
+
export { minArrayLength } from './asserts/array/minArrayLength.mjs';
|
|
9
|
+
export { bigint } from './asserts/bigint/index.mjs';
|
|
10
|
+
export { bigintMax } from './asserts/bigint/bigintMax.mjs';
|
|
11
|
+
export { bigintMaxExcluded } from './asserts/bigint/bigintMaxExcluded.mjs';
|
|
12
|
+
export { bigintMin } from './asserts/bigint/bigintMin.mjs';
|
|
13
|
+
export { bigintMinExcluded } from './asserts/bigint/bigintMinExcluded.mjs';
|
|
14
|
+
export { boolean } from './asserts/boolean/index.mjs';
|
|
15
|
+
export { date } from './asserts/date/index.mjs';
|
|
16
|
+
export { dateMax } from './asserts/date/dateMax.mjs';
|
|
17
|
+
export { dateMin } from './asserts/date/dateMin.mjs';
|
|
18
|
+
export { oneOfTypes } from './asserts/mix/index.mjs';
|
|
19
|
+
export { equalTo } from './asserts/mix/equalTo.mjs';
|
|
20
|
+
export { oneOfValues } from './asserts/mix/oneOfValues.mjs';
|
|
21
|
+
export { number } from './asserts/number/index.mjs';
|
|
22
|
+
export { max } from './asserts/number/max.mjs';
|
|
23
|
+
export { maxExcluded } from './asserts/number/maxExcluded.mjs';
|
|
24
|
+
export { min } from './asserts/number/min.mjs';
|
|
25
|
+
export { minExcluded } from './asserts/number/minExcluded.mjs';
|
|
26
|
+
export { positive } from './asserts/number/positive.mjs';
|
|
27
|
+
export { negative } from './asserts/number/negative.mjs';
|
|
28
|
+
export { object } from './asserts/object/index.mjs';
|
|
29
|
+
export { maxKeys } from './asserts/object/maxKeys.mjs';
|
|
30
|
+
export { string } from './asserts/string/index.mjs';
|
|
31
|
+
export { atLeastOneDigit } from './asserts/string/atLeastOneDigit.mjs';
|
|
32
|
+
export { atLeastOneLowerChar } from './asserts/string/atLeastOneLowerChar.mjs';
|
|
33
|
+
export { atLeastOneSpecialChar } from './asserts/string/atLeastOneSpecialChar.mjs';
|
|
34
|
+
export { atLeastOneUpperChar } from './asserts/string/atLeastOneUpperChar.mjs';
|
|
35
|
+
export { contains } from './asserts/string/contains.mjs';
|
|
36
|
+
export { email } from './asserts/string/email.mjs';
|
|
37
|
+
export { endsWith } from './asserts/string/endsWith.mjs';
|
|
38
|
+
export { isValidDate } from './asserts/string/isValidDate.mjs';
|
|
39
|
+
export { isValidDateTime } from './asserts/string/isValidDateTime.mjs';
|
|
40
|
+
export { isValidTime } from './asserts/string/isValidTime.mjs';
|
|
41
|
+
export { lowerCase } from './asserts/string/lowerCase.mjs';
|
|
42
|
+
export { maxLength } from './asserts/string/maxLength.mjs';
|
|
43
|
+
export { minLength } from './asserts/string/minLength.mjs';
|
|
44
|
+
export { regExp } from './asserts/string/regExp.mjs';
|
|
45
|
+
export { startsWith } from './asserts/string/startsWith.mjs';
|
|
46
|
+
export { upperCase } from './asserts/string/upperCase.mjs';
|
|
47
|
+
export { uuid } from './asserts/string/uuid.mjs';
|
|
48
|
+
export { uuidV1 } from './asserts/string/uuidV1.mjs';
|
|
49
|
+
export { uuidV2 } from './asserts/string/uuidV2.mjs';
|
|
50
|
+
export { uuidV3 } from './asserts/string/uuidV3.mjs';
|
|
51
|
+
export { uuidV4 } from './asserts/string/uuidV4.mjs';
|
|
52
|
+
export { uuidV5 } from './asserts/string/uuidV5.mjs';
|
|
53
|
+
export { validUrl } from './asserts/string/validUrl.mjs';
|
|
6
54
|
import './commonTypes.mjs';
|
|
7
|
-
import './
|
|
8
|
-
import './ExceptionContext.mjs';
|
|
55
|
+
import './helpers/constants.mjs';
|