@oxog/vld 1.3.1 → 1.5.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 +333 -284
- package/README.md +13 -12
- package/dist/cli/benchmark.d.ts +15 -0
- package/dist/cli/benchmark.d.ts.map +1 -0
- package/dist/cli/benchmark.js +248 -0
- package/dist/cli/benchmark.js.map +1 -0
- package/dist/cli/bin.d.ts +8 -0
- package/dist/cli/bin.d.ts.map +1 -0
- package/dist/cli/bin.js +35 -0
- package/dist/cli/bin.js.map +1 -0
- package/dist/cli/commands/benchmark.d.ts +11 -0
- package/dist/cli/commands/benchmark.d.ts.map +1 -0
- package/dist/cli/commands/benchmark.js +204 -0
- package/dist/cli/commands/benchmark.js.map +1 -0
- package/dist/cli/commands/validate.d.ts +11 -0
- package/dist/cli/commands/validate.d.ts.map +1 -0
- package/dist/cli/commands/validate.js +157 -0
- package/dist/cli/commands/validate.js.map +1 -0
- package/dist/cli/generate.d.ts +14 -0
- package/dist/cli/generate.d.ts.map +1 -0
- package/dist/cli/generate.js +233 -0
- package/dist/cli/generate.js.map +1 -0
- package/dist/cli/index.d.ts +59 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +182 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/validate.d.ts +15 -0
- package/dist/cli/validate.d.ts.map +1 -0
- package/dist/cli/validate.js +162 -0
- package/dist/cli/validate.js.map +1 -0
- package/dist/codecs/index.d.ts.map +1 -1
- package/dist/codecs/index.js +29 -10
- package/dist/codecs/index.js.map +1 -1
- package/dist/coercion/bigint.js +1 -1
- package/dist/coercion/boolean.d.ts.map +1 -1
- package/dist/coercion/boolean.js +24 -32
- package/dist/coercion/boolean.js.map +1 -1
- package/dist/coercion/date.js +2 -2
- package/dist/coercion/date.js.map +1 -1
- package/dist/coercion/number.d.ts.map +1 -1
- package/dist/coercion/number.js +20 -4
- package/dist/coercion/number.js.map +1 -1
- package/dist/coercion/string.d.ts.map +1 -1
- package/dist/coercion/string.js +9 -73
- package/dist/coercion/string.js.map +1 -1
- package/dist/compat/emitter.d.ts +73 -0
- package/dist/compat/emitter.d.ts.map +1 -0
- package/dist/compat/emitter.js +179 -0
- package/dist/compat/emitter.js.map +1 -0
- package/dist/compat/index.d.ts +15 -0
- package/dist/compat/index.d.ts.map +1 -0
- package/dist/compat/index.js +14 -0
- package/dist/compat/index.js.map +1 -0
- package/dist/compat/result.d.ts +128 -0
- package/dist/compat/result.d.ts.map +1 -0
- package/dist/compat/result.js +169 -0
- package/dist/compat/result.js.map +1 -0
- package/dist/errors.d.ts +58 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +97 -9
- package/dist/errors.js.map +1 -1
- package/dist/events.d.ts +140 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +8 -0
- package/dist/events.js.map +1 -0
- package/dist/guards.d.ts +143 -0
- package/dist/guards.d.ts.map +1 -0
- package/dist/guards.js +238 -0
- package/dist/guards.js.map +1 -0
- package/dist/index.d.ts +606 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +105 -6
- package/dist/index.js.map +1 -1
- package/dist/kernel.d.ts +29 -0
- package/dist/kernel.d.ts.map +1 -0
- package/dist/kernel.js +402 -0
- package/dist/kernel.js.map +1 -0
- package/dist/locales/af.d.ts.map +1 -1
- package/dist/locales/af.js +18 -1
- package/dist/locales/af.js.map +1 -1
- package/dist/locales/ar.d.ts.map +1 -1
- package/dist/locales/ar.js +18 -1
- package/dist/locales/ar.js.map +1 -1
- package/dist/locales/backup-en.d.ts +3 -0
- package/dist/locales/backup-en.d.ts.map +1 -0
- package/dist/locales/backup-en.js +105 -0
- package/dist/locales/backup-en.js.map +1 -0
- package/dist/locales/bn.d.ts.map +1 -1
- package/dist/locales/bn.js +18 -1
- package/dist/locales/bn.js.map +1 -1
- package/dist/locales/da.d.ts.map +1 -1
- package/dist/locales/da.js +18 -1
- package/dist/locales/da.js.map +1 -1
- package/dist/locales/de.d.ts.map +1 -1
- package/dist/locales/de.js +18 -1
- package/dist/locales/de.js.map +1 -1
- package/dist/locales/en.d.ts.map +1 -1
- package/dist/locales/en.js +18 -1
- package/dist/locales/en.js.map +1 -1
- package/dist/locales/es-MX.d.ts.map +1 -1
- package/dist/locales/es-MX.js +17 -1
- package/dist/locales/es-MX.js.map +1 -1
- package/dist/locales/es.d.ts.map +1 -1
- package/dist/locales/es.js +18 -1
- package/dist/locales/es.js.map +1 -1
- package/dist/locales/fi.d.ts.map +1 -1
- package/dist/locales/fi.js +18 -1
- package/dist/locales/fi.js.map +1 -1
- package/dist/locales/fr.d.ts.map +1 -1
- package/dist/locales/fr.js +18 -1
- package/dist/locales/fr.js.map +1 -1
- package/dist/locales/hi.d.ts.map +1 -1
- package/dist/locales/hi.js +18 -1
- package/dist/locales/hi.js.map +1 -1
- package/dist/locales/id.d.ts.map +1 -1
- package/dist/locales/id.js +18 -1
- package/dist/locales/id.js.map +1 -1
- package/dist/locales/it.d.ts.map +1 -1
- package/dist/locales/it.js +18 -1
- package/dist/locales/it.js.map +1 -1
- package/dist/locales/ja.d.ts.map +1 -1
- package/dist/locales/ja.js +18 -1
- package/dist/locales/ja.js.map +1 -1
- package/dist/locales/ko.d.ts.map +1 -1
- package/dist/locales/ko.js +18 -1
- package/dist/locales/ko.js.map +1 -1
- package/dist/locales/nl.d.ts.map +1 -1
- package/dist/locales/nl.js +18 -1
- package/dist/locales/nl.js.map +1 -1
- package/dist/locales/no.d.ts.map +1 -1
- package/dist/locales/no.js +18 -1
- package/dist/locales/no.js.map +1 -1
- package/dist/locales/pl.d.ts.map +1 -1
- package/dist/locales/pl.js +18 -1
- package/dist/locales/pl.js.map +1 -1
- package/dist/locales/pt-BR.d.ts.map +1 -1
- package/dist/locales/pt-BR.js +18 -1
- package/dist/locales/pt-BR.js.map +1 -1
- package/dist/locales/pt.d.ts.map +1 -1
- package/dist/locales/pt.js +18 -1
- package/dist/locales/pt.js.map +1 -1
- package/dist/locales/ru.d.ts.map +1 -1
- package/dist/locales/ru.js +18 -1
- package/dist/locales/ru.js.map +1 -1
- package/dist/locales/sv.d.ts.map +1 -1
- package/dist/locales/sv.js +18 -1
- package/dist/locales/sv.js.map +1 -1
- package/dist/locales/sw.d.ts.map +1 -1
- package/dist/locales/sw.js +18 -1
- package/dist/locales/sw.js.map +1 -1
- package/dist/locales/th.d.ts.map +1 -1
- package/dist/locales/th.js +18 -1
- package/dist/locales/th.js.map +1 -1
- package/dist/locales/tr.d.ts.map +1 -1
- package/dist/locales/tr.js +18 -1
- package/dist/locales/tr.js.map +1 -1
- package/dist/locales/types.d.ts +13 -0
- package/dist/locales/types.d.ts.map +1 -1
- package/dist/locales/types.js.map +1 -1
- package/dist/locales/vi.d.ts.map +1 -1
- package/dist/locales/vi.js +18 -1
- package/dist/locales/vi.js.map +1 -1
- package/dist/locales/zh.d.ts.map +1 -1
- package/dist/locales/zh.js +18 -1
- package/dist/locales/zh.js.map +1 -1
- package/dist/logger.d.ts +94 -0
- package/dist/logger.d.ts.map +1 -0
- package/dist/logger.js +184 -0
- package/dist/logger.js.map +1 -0
- package/dist/pigment.d.ts +124 -0
- package/dist/pigment.d.ts.map +1 -0
- package/dist/pigment.js +177 -0
- package/dist/pigment.js.map +1 -0
- package/dist/plugins/codecs.d.ts +17 -0
- package/dist/plugins/codecs.d.ts.map +1 -0
- package/dist/plugins/codecs.js +29 -0
- package/dist/plugins/codecs.js.map +1 -0
- package/dist/plugins/coercion.d.ts +13 -0
- package/dist/plugins/coercion.d.ts.map +1 -0
- package/dist/plugins/coercion.js +34 -0
- package/dist/plugins/coercion.js.map +1 -0
- package/dist/plugins/core-validators.d.ts +13 -0
- package/dist/plugins/core-validators.d.ts.map +1 -0
- package/dist/plugins/core-validators.js +96 -0
- package/dist/plugins/core-validators.js.map +1 -0
- package/dist/plugins/index.d.ts +8 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +8 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/kernel.d.ts +29 -0
- package/dist/plugins/kernel.d.ts.map +1 -0
- package/dist/plugins/kernel.js +486 -0
- package/dist/plugins/kernel.js.map +1 -0
- package/dist/plugins/types.d.ts +186 -0
- package/dist/plugins/types.d.ts.map +1 -0
- package/dist/plugins/types.js +8 -0
- package/dist/plugins/types.js.map +1 -0
- package/dist/style.d.ts +123 -0
- package/dist/style.d.ts.map +1 -0
- package/dist/style.js +369 -0
- package/dist/style.js.map +1 -0
- package/dist/utils/codec-utils.d.ts +2 -0
- package/dist/utils/codec-utils.d.ts.map +1 -1
- package/dist/utils/codec-utils.js +28 -4
- package/dist/utils/codec-utils.js.map +1 -1
- package/dist/utils/deep-merge.d.ts +2 -0
- package/dist/utils/deep-merge.d.ts.map +1 -1
- package/dist/utils/deep-merge.js +22 -39
- package/dist/utils/deep-merge.js.map +1 -1
- package/dist/utils/ip-validation.d.ts +11 -0
- package/dist/utils/ip-validation.d.ts.map +1 -0
- package/dist/utils/ip-validation.js +98 -0
- package/dist/utils/ip-validation.js.map +1 -0
- package/dist/utils/security.d.ts +12 -0
- package/dist/utils/security.d.ts.map +1 -0
- package/dist/utils/security.js +61 -0
- package/dist/utils/security.js.map +1 -0
- package/dist/validators/array.d.ts +3 -1
- package/dist/validators/array.d.ts.map +1 -1
- package/dist/validators/array.js +41 -15
- package/dist/validators/array.js.map +1 -1
- package/dist/validators/base.d.ts +134 -0
- package/dist/validators/base.d.ts.map +1 -1
- package/dist/validators/base.js +255 -1
- package/dist/validators/base.js.map +1 -1
- package/dist/validators/base64.js +1 -1
- package/dist/validators/bigint.d.ts +20 -0
- package/dist/validators/bigint.d.ts.map +1 -1
- package/dist/validators/bigint.js +39 -1
- package/dist/validators/bigint.js.map +1 -1
- package/dist/validators/boolean.js +29 -1
- package/dist/validators/boolean.js.map +1 -1
- package/dist/validators/codec.js +1 -1
- package/dist/validators/custom.d.ts +47 -0
- package/dist/validators/custom.d.ts.map +1 -0
- package/dist/validators/custom.js +50 -0
- package/dist/validators/custom.js.map +1 -0
- package/dist/validators/date.d.ts +16 -0
- package/dist/validators/date.d.ts.map +1 -1
- package/dist/validators/date.js +62 -7
- package/dist/validators/date.js.map +1 -1
- package/dist/validators/discriminated-union.d.ts +29 -0
- package/dist/validators/discriminated-union.d.ts.map +1 -0
- package/dist/validators/discriminated-union.js +98 -0
- package/dist/validators/discriminated-union.js.map +1 -0
- package/dist/validators/enum.d.ts +10 -0
- package/dist/validators/enum.d.ts.map +1 -1
- package/dist/validators/enum.js +38 -1
- package/dist/validators/enum.js.map +1 -1
- package/dist/validators/file.d.ts +57 -0
- package/dist/validators/file.d.ts.map +1 -0
- package/dist/validators/file.js +114 -0
- package/dist/validators/file.js.map +1 -0
- package/dist/validators/function.d.ts +26 -0
- package/dist/validators/function.d.ts.map +1 -0
- package/dist/validators/function.js +45 -0
- package/dist/validators/function.js.map +1 -0
- package/dist/validators/hex.d.ts.map +1 -1
- package/dist/validators/hex.js +3 -2
- package/dist/validators/hex.js.map +1 -1
- package/dist/validators/index.d.ts +18 -1
- package/dist/validators/index.d.ts.map +1 -1
- package/dist/validators/index.js +16 -1
- package/dist/validators/index.js.map +1 -1
- package/dist/validators/intersection.d.ts.map +1 -1
- package/dist/validators/intersection.js +15 -8
- package/dist/validators/intersection.js.map +1 -1
- package/dist/validators/json.d.ts +26 -0
- package/dist/validators/json.d.ts.map +1 -0
- package/dist/validators/json.js +64 -0
- package/dist/validators/json.js.map +1 -0
- package/dist/validators/lazy.d.ts +28 -0
- package/dist/validators/lazy.d.ts.map +1 -0
- package/dist/validators/lazy.js +42 -0
- package/dist/validators/lazy.js.map +1 -0
- package/dist/validators/literal.js +1 -1
- package/dist/validators/map.js +1 -1
- package/dist/validators/nan.d.ts +17 -0
- package/dist/validators/nan.d.ts.map +1 -0
- package/dist/validators/nan.js +32 -0
- package/dist/validators/nan.js.map +1 -0
- package/dist/validators/never.js +1 -1
- package/dist/validators/null.d.ts +16 -0
- package/dist/validators/null.d.ts.map +1 -0
- package/dist/validators/null.js +31 -0
- package/dist/validators/null.js.map +1 -0
- package/dist/validators/number.d.ts +22 -0
- package/dist/validators/number.d.ts.map +1 -1
- package/dist/validators/number.js +47 -8
- package/dist/validators/number.js.map +1 -1
- package/dist/validators/object.d.ts +32 -0
- package/dist/validators/object.d.ts.map +1 -1
- package/dist/validators/object.js +125 -8
- package/dist/validators/object.js.map +1 -1
- package/dist/validators/record.d.ts +15 -2
- package/dist/validators/record.d.ts.map +1 -1
- package/dist/validators/record.js +74 -4
- package/dist/validators/record.js.map +1 -1
- package/dist/validators/set.js +1 -1
- package/dist/validators/string-bool.d.ts +61 -0
- package/dist/validators/string-bool.d.ts.map +1 -0
- package/dist/validators/string-bool.js +127 -0
- package/dist/validators/string-bool.js.map +1 -0
- package/dist/validators/string-formats.d.ts +97 -0
- package/dist/validators/string-formats.d.ts.map +1 -0
- package/dist/validators/string-formats.js +120 -0
- package/dist/validators/string-formats.js.map +1 -0
- package/dist/validators/string.d.ts.map +1 -1
- package/dist/validators/string.js +2 -73
- package/dist/validators/string.js.map +1 -1
- package/dist/validators/symbol.js +1 -1
- package/dist/validators/template-literal.d.ts +32 -0
- package/dist/validators/template-literal.d.ts.map +1 -0
- package/dist/validators/template-literal.js +102 -0
- package/dist/validators/template-literal.js.map +1 -0
- package/dist/validators/tuple.js +1 -1
- package/dist/validators/uint8array.d.ts +21 -4
- package/dist/validators/uint8array.d.ts.map +1 -1
- package/dist/validators/uint8array.js +34 -23
- package/dist/validators/uint8array.js.map +1 -1
- package/dist/validators/undefined.d.ts +16 -0
- package/dist/validators/undefined.d.ts.map +1 -0
- package/dist/validators/undefined.js +31 -0
- package/dist/validators/undefined.js.map +1 -0
- package/dist/validators/union.d.ts +2 -0
- package/dist/validators/union.d.ts.map +1 -1
- package/dist/validators/union.js +15 -21
- package/dist/validators/union.js.map +1 -1
- package/dist/validators/void.js +1 -1
- package/dist/validators/xor.d.ts +23 -0
- package/dist/validators/xor.d.ts.map +1 -0
- package/dist/validators/xor.js +64 -0
- package/dist/validators/xor.js.map +1 -0
- package/package.json +95 -79
package/CHANGELOG.md
CHANGED
|
@@ -1,285 +1,334 @@
|
|
|
1
|
-
# Changelog
|
|
2
|
-
|
|
3
|
-
All notable changes to VLD will be documented in this file.
|
|
4
|
-
|
|
5
|
-
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
-
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
-
|
|
8
|
-
## [1.
|
|
9
|
-
|
|
10
|
-
###
|
|
11
|
-
- **
|
|
12
|
-
- **
|
|
13
|
-
- **
|
|
14
|
-
|
|
15
|
-
###
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
-
|
|
21
|
-
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
-
|
|
28
|
-
|
|
29
|
-
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
-
|
|
37
|
-
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
- **
|
|
42
|
-
- **
|
|
43
|
-
- **
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
- **
|
|
48
|
-
- **
|
|
49
|
-
- **
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- **
|
|
54
|
-
- **
|
|
55
|
-
- **
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
- **
|
|
61
|
-
- **
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
- **Security
|
|
71
|
-
- **
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
###
|
|
76
|
-
- **
|
|
77
|
-
- **
|
|
78
|
-
- **
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
- **
|
|
85
|
-
- **
|
|
86
|
-
- **
|
|
87
|
-
|
|
88
|
-
- **
|
|
89
|
-
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
#### **
|
|
101
|
-
|
|
102
|
-
**
|
|
103
|
-
-
|
|
104
|
-
- `
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
**
|
|
110
|
-
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
**
|
|
115
|
-
-
|
|
116
|
-
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
**
|
|
120
|
-
-
|
|
121
|
-
-
|
|
122
|
-
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
-
|
|
126
|
-
-
|
|
127
|
-
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
-
|
|
134
|
-
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
-
|
|
138
|
-
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
- **
|
|
144
|
-
-
|
|
145
|
-
-
|
|
146
|
-
-
|
|
147
|
-
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
-
|
|
153
|
-
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
-
|
|
175
|
-
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
-
|
|
195
|
-
- `
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
-
|
|
206
|
-
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
-
|
|
211
|
-
-
|
|
212
|
-
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
-
|
|
218
|
-
-
|
|
219
|
-
-
|
|
220
|
-
|
|
221
|
-
###
|
|
222
|
-
-
|
|
223
|
-
-
|
|
224
|
-
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
-
|
|
233
|
-
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
-
|
|
240
|
-
-
|
|
241
|
-
-
|
|
242
|
-
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
-
|
|
246
|
-
-
|
|
247
|
-
-
|
|
248
|
-
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
-
|
|
253
|
-
-
|
|
254
|
-
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
-
|
|
259
|
-
-
|
|
260
|
-
-
|
|
261
|
-
-
|
|
262
|
-
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
-
|
|
266
|
-
-
|
|
267
|
-
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
-
|
|
272
|
-
-
|
|
273
|
-
-
|
|
274
|
-
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to VLD will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.4.0] - 2026-01-02
|
|
9
|
+
|
|
10
|
+
### 🚀 **Zod 4 Full API Parity Achieved**
|
|
11
|
+
- **Complete Feature Set**: 100% Zod 4 API compatibility
|
|
12
|
+
- **1142 Tests Passing**: Comprehensive test coverage across all features
|
|
13
|
+
- **Production Ready**: All validators, codecs, and utilities fully tested
|
|
14
|
+
|
|
15
|
+
### ✨ New Features
|
|
16
|
+
|
|
17
|
+
#### **v.cidrv6() - IPv6 CIDR Block Validator**
|
|
18
|
+
New validator for IPv6 CIDR notation validation:
|
|
19
|
+
- Supports full IPv6 addresses with prefix lengths (0-128)
|
|
20
|
+
- Validates compressed IPv6 notation (`::`, `::1`, etc.)
|
|
21
|
+
- Rejects IPv4 CIDR blocks
|
|
22
|
+
|
|
23
|
+
#### **.apply() - External Function Chaining**
|
|
24
|
+
Apply external functions to validators for advanced composition:
|
|
25
|
+
- Enables functional composition patterns
|
|
26
|
+
- Supports custom validation pipelines
|
|
27
|
+
- Full TypeScript type inference
|
|
28
|
+
|
|
29
|
+
#### **.safeExtend() - Type-Safe Object Extension**
|
|
30
|
+
Safely extend object schemas without accidentally overriding existing fields:
|
|
31
|
+
- Prevents accidental field overrides in object schemas
|
|
32
|
+
- Clear error messages listing all conflicting keys
|
|
33
|
+
- Supports chaining multiple safeExtend calls
|
|
34
|
+
|
|
35
|
+
### 🌍 Internationalization Updates
|
|
36
|
+
- Added i18n messages for all new features in **27+ languages**
|
|
37
|
+
- New messages: `stringCidrv6`, `safeExtendOverlap`
|
|
38
|
+
- Updated all locale files with translations
|
|
39
|
+
|
|
40
|
+
### 🔧 Build System Improvements
|
|
41
|
+
- **Fixed ESM module resolution**: Directory imports now correctly resolve to `/index.js`
|
|
42
|
+
- **Updated fix-imports script**: Now handles directory-based imports properly
|
|
43
|
+
- **Renamed to CommonJS**: `scripts/fix-imports.cjs` for ESM package compatibility
|
|
44
|
+
|
|
45
|
+
### 📊 Performance
|
|
46
|
+
VLD continues to outperform Zod across all benchmarks:
|
|
47
|
+
- **2.52x faster** average performance
|
|
48
|
+
- **9/10 benchmark wins** vs Zod
|
|
49
|
+
- **2.41x less memory** usage overall
|
|
50
|
+
- **83x faster** schema creation
|
|
51
|
+
|
|
52
|
+
### 🧪 Testing
|
|
53
|
+
- **49 test suites** - All passing
|
|
54
|
+
- **1142 tests** - Comprehensive coverage
|
|
55
|
+
- **TypeScript strict mode** - Full type safety verified
|
|
56
|
+
|
|
57
|
+
## [1.3.1] - 2025-11-12
|
|
58
|
+
|
|
59
|
+
### 🎯 **100% Test Success Rate Achieved**
|
|
60
|
+
- **Perfect Test Coverage**: All 695 tests now passing (0 failures)
|
|
61
|
+
- **IPv6 Validation Fix**: Resolved final failing test for IPv6-mapped addresses
|
|
62
|
+
- **Security Validation**: All 4 critical security fixes thoroughly tested
|
|
63
|
+
|
|
64
|
+
### 🔧 Bug Fixes
|
|
65
|
+
- **IPv6 Validation**: Fixed validation for IPv4-mapped IPv6 addresses (`::ffff:192.0.2.1`)
|
|
66
|
+
- **Test Coverage**: Updated documentation to reflect 695 passing tests (up from 694)
|
|
67
|
+
|
|
68
|
+
### ✅ Quality Assurance
|
|
69
|
+
- **100% Test Success**: Achieved perfect test success rate across all test suites
|
|
70
|
+
- **Security Hardening**: All security vulnerabilities validated with comprehensive tests
|
|
71
|
+
- **Performance Maintained**: No performance impact from security improvements
|
|
72
|
+
|
|
73
|
+
## [1.3.0] - 2025-11-12
|
|
74
|
+
|
|
75
|
+
### 🔒 **Critical Security Update**
|
|
76
|
+
- **SECURITY**: Fixed 4 critical security vulnerabilities identified in comprehensive bug analysis
|
|
77
|
+
- **Enhanced Security**: Comprehensive protection against prototype pollution, ReDoS attacks, and type safety issues
|
|
78
|
+
- **Security-First**: All validators now include security controls while maintaining backwards compatibility
|
|
79
|
+
|
|
80
|
+
### 🛡️ Security Fixes Implemented
|
|
81
|
+
|
|
82
|
+
#### **BUG-001: Union Validator Type Safety** ✅ FIXED
|
|
83
|
+
- **Issue**: Constructor name spoofing vulnerability in union validators
|
|
84
|
+
- **Solution**: Replaced constructor name checking with secure feature detection
|
|
85
|
+
- **Impact**: Prevents malicious validator objects from bypassing type checks
|
|
86
|
+
- **Location**: `src/validators/union.ts`
|
|
87
|
+
|
|
88
|
+
#### **BUG-002: Prototype Pollution Prevention** ✅ FIXED
|
|
89
|
+
- **Issue**: Prototype pollution vulnerability in codec utilities
|
|
90
|
+
- **Solution**: Added comprehensive input validation and suspicious content detection
|
|
91
|
+
- **Impact**: Prevents `__proto__`, `constructor`, and `prototype` pollution attacks
|
|
92
|
+
- **Location**: `src/utils/codec-utils.ts`
|
|
93
|
+
|
|
94
|
+
#### **BUG-004: IPv6 ReDoS Prevention** ✅ FIXED
|
|
95
|
+
- **Issue**: Regular Expression Denial of Service (ReDoS) vulnerability in IPv6 validation
|
|
96
|
+
- **Solution**: Replaced complex regex with multi-step validation approach
|
|
97
|
+
- **Impact**: Prevents catastrophic backtracking attacks while maintaining IPv6 support
|
|
98
|
+
- **Location**: `src/validators/string.ts`, `src/coercion/string.ts`
|
|
99
|
+
|
|
100
|
+
#### **BUG-005: Safe String Coercion** ✅ FIXED
|
|
101
|
+
- **Issue**: Unsafe type coercion without length limits or sanitization
|
|
102
|
+
- **Solution**: Added length limits (1M characters) and control character sanitization
|
|
103
|
+
- **Impact**: Prevents DoS attacks and information disclosure through malicious strings
|
|
104
|
+
- **Location**: `src/coercion/string.ts`
|
|
105
|
+
|
|
106
|
+
### 📊 Quality Improvements
|
|
107
|
+
- **Test Coverage**: Maintained excellent coverage at **96.55%** with **695 passing tests**
|
|
108
|
+
- **Performance**: All security improvements maintain VLD's performance advantages
|
|
109
|
+
- **Backwards Compatibility**: All changes are fully backwards compatible
|
|
110
|
+
- **Security Testing**: Comprehensive security test suite added with 18 dedicated tests
|
|
111
|
+
|
|
112
|
+
### 🧪 Testing & Validation
|
|
113
|
+
- **Security Test Suite**: Added comprehensive security validation tests
|
|
114
|
+
- **Performance Tests**: Verified security fixes don't impact performance
|
|
115
|
+
- **Integration Tests**: Validated compatibility with existing codebases
|
|
116
|
+
- **Memory Tests**: Confirmed no memory leaks with security enhancements
|
|
117
|
+
|
|
118
|
+
### 📝 Documentation Updates
|
|
119
|
+
- **Security Documentation**: Detailed security analysis reports created
|
|
120
|
+
- **Bug Fix Reports**: Comprehensive documentation of all fixes implemented
|
|
121
|
+
- **Test Coverage**: Updated coverage metrics to reflect new security tests
|
|
122
|
+
- **README**: Updated to reflect latest test coverage and security improvements
|
|
123
|
+
|
|
124
|
+
### 🔧 Technical Details
|
|
125
|
+
- **Zero Breaking Changes**: All security improvements are backwards compatible
|
|
126
|
+
- **Immutable Architecture**: Security hardening maintains VLD's immutable validator pattern
|
|
127
|
+
- **Type Safety**: Enhanced type checking without compromising TypeScript inference
|
|
128
|
+
- **Error Handling**: Improved error messages for security-related validation failures
|
|
129
|
+
|
|
130
|
+
## [1.2.0] - 2025-08-24
|
|
131
|
+
|
|
132
|
+
### 🎯 **100% Test Success Rate Achieved**
|
|
133
|
+
- **569 tests passing** with 0 failures across all test suites
|
|
134
|
+
- **97.3% statement coverage** (up from 97.18%)
|
|
135
|
+
- **93.5% branch coverage**
|
|
136
|
+
- **96.78% function coverage**
|
|
137
|
+
- **97.6% line coverage**
|
|
138
|
+
- All Zod-compatible codec tests now fully passing
|
|
139
|
+
|
|
140
|
+
### 🚀 Major Features Added
|
|
141
|
+
|
|
142
|
+
#### **Codec System - Bidirectional Transformations**
|
|
143
|
+
- **NEW**: Complete codec system for bidirectional data transformations
|
|
144
|
+
- `v.codec()` factory method for creating custom codecs
|
|
145
|
+
- Full encode/decode support with type safety
|
|
146
|
+
- Async codec support with `parseAsync()` and `encodeAsync()` methods
|
|
147
|
+
- Comprehensive error handling for both directions
|
|
148
|
+
|
|
149
|
+
#### **19 Built-in Zod-Compatible Codecs**
|
|
150
|
+
|
|
151
|
+
**String Conversion Codecs:**
|
|
152
|
+
- `stringToNumber` - String ↔ Number with validation
|
|
153
|
+
- `stringToInt` - String ↔ Integer with validation
|
|
154
|
+
- `stringToBigInt` - String ↔ BigInt conversion
|
|
155
|
+
- `numberToBigInt` - Number ↔ BigInt conversion
|
|
156
|
+
- `stringToBoolean` - Flexible string ↔ boolean (`'true'`, `'1'`, `'yes'`, `'on'` → `true`)
|
|
157
|
+
|
|
158
|
+
**Date Conversion Codecs:**
|
|
159
|
+
- `isoDatetimeToDate` - ISO 8601 string ↔ Date object
|
|
160
|
+
- `epochSecondsToDate` - Unix seconds ↔ Date object
|
|
161
|
+
- `epochMillisToDate` - Unix milliseconds ↔ Date object
|
|
162
|
+
|
|
163
|
+
**JSON and Complex Data:**
|
|
164
|
+
- `jsonCodec()` - Generic JSON string ↔ any type
|
|
165
|
+
- `base64Json()` - Base64-encoded JSON with schema validation
|
|
166
|
+
- `jwtPayload()` - JWT payload decoder (read-only)
|
|
167
|
+
|
|
168
|
+
**URL and Web:**
|
|
169
|
+
- `stringToURL` - String ↔ URL object
|
|
170
|
+
- `stringToHttpURL` - HTTP/HTTPS URL validation and conversion
|
|
171
|
+
- `uriComponent` - URI component encode/decode
|
|
172
|
+
|
|
173
|
+
**Binary Data:**
|
|
174
|
+
- `base64ToBytes` - Base64 ↔ Uint8Array
|
|
175
|
+
- `base64urlToBytes` - URL-safe Base64 ↔ Uint8Array
|
|
176
|
+
- `hexToBytes` - Hexadecimal ↔ Uint8Array
|
|
177
|
+
- `utf8ToBytes` - UTF-8 string ↔ Uint8Array
|
|
178
|
+
- `bytesToUtf8` - Uint8Array ↔ UTF-8 string
|
|
179
|
+
|
|
180
|
+
#### **New Validator Types**
|
|
181
|
+
- `v.base64()` - Base64 string validation with URL-safe mode
|
|
182
|
+
- `v.hex()` - Hexadecimal string validation with lowercase mode
|
|
183
|
+
- `v.uint8Array()` - Uint8Array validation with length constraints
|
|
184
|
+
|
|
185
|
+
#### **Enhanced Utilities**
|
|
186
|
+
- Comprehensive codec utility functions in `codec-utils.ts`
|
|
187
|
+
- Cross-platform Base64 encoding/decoding (Node.js + Browser)
|
|
188
|
+
- Secure error handling for all codec operations
|
|
189
|
+
|
|
190
|
+
### 📚 Documentation Updates
|
|
191
|
+
- **README.md**: Comprehensive codec documentation with examples
|
|
192
|
+
- **API.md**: Complete codec API reference with TypeScript examples
|
|
193
|
+
- **New Examples**:
|
|
194
|
+
- `examples/codecs.js` - JavaScript codec examples
|
|
195
|
+
- `examples/codecs.ts` - TypeScript codec examples with full type safety
|
|
196
|
+
- Updated CLAUDE.md with codec development guidance
|
|
197
|
+
|
|
198
|
+
### 🔧 Technical Improvements
|
|
199
|
+
- **Zero Circular Dependencies**: Refactored codec architecture
|
|
200
|
+
- **Full Type Safety**: Complete TypeScript support with inference
|
|
201
|
+
- **97.3% Test Coverage**: Comprehensive test suite with 569 passing tests
|
|
202
|
+
- **Error Message Localization**: All codec errors support 27+ languages
|
|
203
|
+
|
|
204
|
+
### 🎯 Zod Compatibility
|
|
205
|
+
- **100% Zod Codec Parity**: All Zod codecs implemented and compatible
|
|
206
|
+
- **Beyond Zod**: Additional codecs not available in Zod
|
|
207
|
+
- **Drop-in Replacement**: Seamless migration path from Zod codecs
|
|
208
|
+
|
|
209
|
+
### Performance
|
|
210
|
+
- **Optimized Transformations**: Efficient bidirectional conversions
|
|
211
|
+
- **Memory Efficient**: Immutable codec architecture prevents leaks
|
|
212
|
+
- **Async Support**: Non-blocking operations for I/O-bound transformations
|
|
213
|
+
|
|
214
|
+
## [1.1.1] - 2025-08-18
|
|
215
|
+
|
|
216
|
+
### Security
|
|
217
|
+
- **CRITICAL**: Fixed prototype pollution vulnerability in VldObject passthrough mode
|
|
218
|
+
- Added protection against `__proto__`, `constructor`, and `prototype` key pollution
|
|
219
|
+
- Comprehensive security test suite added
|
|
220
|
+
|
|
221
|
+
### Fixed
|
|
222
|
+
- Removed unnecessary escape characters in regex patterns (URL validation)
|
|
223
|
+
- Fixed escape characters in locale files (Afrikaans)
|
|
224
|
+
- Added ESLint configuration for code quality
|
|
225
|
+
|
|
226
|
+
### Added
|
|
227
|
+
- Security test suite with prototype pollution prevention tests
|
|
228
|
+
- Coverage improvement tests for better code quality
|
|
229
|
+
- ESLint configuration with TypeScript support
|
|
230
|
+
|
|
231
|
+
### Changed
|
|
232
|
+
- Improved test coverage to 97.1% statements
|
|
233
|
+
- All linting issues resolved
|
|
234
|
+
|
|
235
|
+
## [1.1.0] - 2025-08-12
|
|
236
|
+
|
|
237
|
+
### Added
|
|
238
|
+
- Professional benchmark suite with real-world performance testing
|
|
239
|
+
- `benchmarks/quick-bench.cjs` - Fast performance comparison
|
|
240
|
+
- `benchmarks/memory.cjs` - Memory usage analysis
|
|
241
|
+
- `benchmarks/startup.cjs` - Startup time comparison
|
|
242
|
+
- `benchmarks/performance.cjs` - Comprehensive benchmark suite
|
|
243
|
+
- Complete documentation overhaul in `/docs` folder:
|
|
244
|
+
- `API.md` - Full API reference with all methods and examples
|
|
245
|
+
- `GETTING_STARTED.md` - Beginner-friendly guide
|
|
246
|
+
- `MIGRATION.md` - Step-by-step Zod to VLD migration
|
|
247
|
+
- `PERFORMANCE.md` - Performance optimization guide
|
|
248
|
+
- `ADVANCED_FEATURES.md` - Deep dive into advanced features
|
|
249
|
+
|
|
250
|
+
### Changed
|
|
251
|
+
- Updated README with accurate benchmark results showing 2.07x average improvement
|
|
252
|
+
- All documentation converted to English
|
|
253
|
+
- Improved build process with automatic ES module import fixes
|
|
254
|
+
- Test coverage increased to 99.5%
|
|
255
|
+
- Cleaned up project structure for better maintainability
|
|
256
|
+
|
|
257
|
+
### Removed
|
|
258
|
+
- Deleted `coverage/` folder (unnecessary for npm package)
|
|
259
|
+
- Removed 12 old benchmark files
|
|
260
|
+
- Cleaned up `src/errors/` and `src/types/` folders
|
|
261
|
+
- Removed redundant test files focused on coverage metrics
|
|
262
|
+
- Deleted unnecessary example files
|
|
263
|
+
|
|
264
|
+
### Fixed
|
|
265
|
+
- Fixed ES module import issues with `.js` extension resolver
|
|
266
|
+
- Resolved CommonJS compatibility for benchmark files
|
|
267
|
+
- Fixed all TypeScript compilation errors
|
|
268
|
+
- Corrected package.json export configurations
|
|
269
|
+
|
|
270
|
+
### Performance
|
|
271
|
+
- Memory usage: 86% less than Zod
|
|
272
|
+
- Startup time: 1.94x faster
|
|
273
|
+
- Schema creation: 8.22x faster
|
|
274
|
+
- Overall performance: 2.07x faster average
|
|
275
|
+
|
|
276
|
+
## [1.0.0] - 2025-08-11
|
|
277
|
+
|
|
278
|
+
### Initial Release
|
|
279
|
+
|
|
280
|
+
#### Core Features
|
|
281
|
+
- **Blazing Fast Performance**: 2-4x faster than Zod in most operations
|
|
282
|
+
- **Zero Dependencies**: Lightweight with no external packages
|
|
283
|
+
- **Full TypeScript Support**: Excellent type inference and IntelliSense
|
|
284
|
+
- **Zod API Compatibility**: Drop-in replacement with identical API
|
|
285
|
+
- **Tree-Shakeable**: Only import what you need
|
|
286
|
+
|
|
287
|
+
#### Validation Types
|
|
288
|
+
- **Primitives**: string, number, boolean, bigint, symbol, date, undefined, null, void, any, unknown, never
|
|
289
|
+
- **Collections**: array, tuple, object, record, map, set
|
|
290
|
+
- **Compositions**: union, intersection, literal, enum
|
|
291
|
+
- **Modifiers**: optional, nullable, nullish, default, catch
|
|
292
|
+
|
|
293
|
+
#### Advanced Features
|
|
294
|
+
- **Type Coercion**: Automatic type conversion for common cases
|
|
295
|
+
- **Custom Validation**: `refine()` and `superRefine()` for custom logic
|
|
296
|
+
- **Data Transformation**: `transform()` for post-validation processing
|
|
297
|
+
- **Object Utilities**: `pick()`, `omit()`, `extend()`, `merge()`, `partial()`
|
|
298
|
+
- **Error Formatting**: Tree, pretty, and flatten utilities
|
|
299
|
+
|
|
300
|
+
#### Internationalization
|
|
301
|
+
- Built-in support for 27+ languages
|
|
302
|
+
- Easy locale switching with `setLocale()`
|
|
303
|
+
- Comprehensive translation coverage
|
|
304
|
+
|
|
305
|
+
#### String Validators
|
|
306
|
+
- Email, URL, UUID validation
|
|
307
|
+
- IP address (v4/v6) validation
|
|
308
|
+
- Regex pattern matching
|
|
309
|
+
- Length constraints (min, max, length)
|
|
310
|
+
- Content checks (includes, startsWith, endsWith)
|
|
311
|
+
- Transformations (trim, toLowerCase, toUpperCase)
|
|
312
|
+
|
|
313
|
+
#### Number Validators
|
|
314
|
+
- Range validation (min, max)
|
|
315
|
+
- Type constraints (int, positive, negative, finite, safe)
|
|
316
|
+
- Mathematical checks (multipleOf)
|
|
317
|
+
|
|
318
|
+
#### Performance Optimizations
|
|
319
|
+
- Optimized for V8 JavaScript engine
|
|
320
|
+
- Minimal memory allocations
|
|
321
|
+
- Fast-path optimizations for common cases
|
|
322
|
+
- Immutable validators prevent memory leaks
|
|
323
|
+
- Pre-computed validation strategies
|
|
324
|
+
|
|
325
|
+
#### Developer Experience
|
|
326
|
+
- Clear, actionable error messages
|
|
327
|
+
- Comprehensive test suite (99.5% coverage)
|
|
328
|
+
- Extensive documentation and examples
|
|
329
|
+
- TypeScript-first design
|
|
330
|
+
- Intuitive, chainable API
|
|
331
|
+
|
|
332
|
+
---
|
|
333
|
+
|
|
285
334
|
For more details, see the [GitHub Releases](https://github.com/ersinkoc/vld/releases)
|