valgen 5.13.4 → 5.14.1
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 +169 -184
- package/cjs/constants.js +3 -1
- package/cjs/rules/type-rules/is-object.js +1 -3
- package/cjs/tsconfig-build-cjs.tsbuildinfo +1 -1
- package/esm/constants.js +2 -0
- package/esm/rules/type-rules/is-object.js +1 -3
- package/esm/tsconfig-build-esm.tsbuildinfo +1 -1
- package/package.json +6 -2
- package/types/constants.d.ts +2 -0
- package/types/core/index.d.ts +1 -1
- package/types/index.d.cts +1 -1
- package/types/index.d.ts +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,299 +1,284 @@
|
|
|
1
|
-
|
|
2
|
-
[2025-03-26]
|
|
1
|
+
## Changelog
|
|
3
2
|
|
|
4
|
-
###
|
|
3
|
+
### [v5.14.1](https://github.com/panates/valgen/compare/v5.14.0...v5.14.1) -
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
#### 🪲 Fixes
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
[2025-03-17]
|
|
7
|
+
- fix: Fixed validation issue while using silent mode @Eray Hanoğlu
|
|
10
8
|
|
|
11
|
-
|
|
9
|
+
#### 💬 General Changes
|
|
12
10
|
|
|
13
|
-
|
|
11
|
+
- dev: Moved from nyc to c8 @Eray Hanoğlu
|
|
12
|
+
- ci: Added workflows @Eray Hanoğlu
|
|
13
|
+
- dev: Fixed nycrc file @Eray Hanoğlu
|
|
14
|
+
- dev: Added publishConfig @Eray Hanoğlu
|
|
15
|
+
- dev: Fixed nycrc file @Eray Hanoğlu
|
|
16
|
+
- dev: Fixed paths @Eray Hanoğlu
|
|
17
|
+
- dev: Fixed nycrc file @Eray Hanoğlu
|
|
18
|
+
- dev: Fixed nycrc file @Eray Hanoğlu
|
|
19
|
+
- dev: Added qc script @Eray Hanoğlu
|
|
14
20
|
|
|
15
|
-
|
|
16
|
-
[2025-03-15]
|
|
21
|
+
### [v5.14.0](https://github.com/panates/valgen/compare/v5.13.4...v5.14.0) - 30 March 2025
|
|
17
22
|
|
|
18
|
-
|
|
23
|
+
#### 🛠 Refactoring and Updates
|
|
19
24
|
|
|
20
|
-
|
|
25
|
+
- refactor: Moved from jest to mocha @Eray Hanoğlu
|
|
21
26
|
|
|
22
|
-
|
|
23
|
-
[2025-03-14]
|
|
27
|
+
### [v5.13.4](https://github.com/panates/valgen/compare/v5.13.3...v5.13.4) - 26 March 2025
|
|
24
28
|
|
|
25
|
-
|
|
29
|
+
#### 🪲 Fixes
|
|
26
30
|
|
|
27
|
-
|
|
28
|
-
* fix: Fixed validation of Date, Buffer and ArrayBuffer objects of isEmpty and isNotEmpty rules ([`37681bf`](https://github.com/panates/valgen/commit/37681bf88f5c0adf4f102856791b0b3a547aea74))
|
|
31
|
+
- fix: isNotEmpty do not work for number and boolean types @Eray Hanoğlu
|
|
29
32
|
|
|
30
|
-
###
|
|
33
|
+
### [v5.13.3](https://github.com/panates/valgen/compare/v5.13.2...v5.13.3) - 17 March 2025
|
|
31
34
|
|
|
32
|
-
|
|
35
|
+
#### 🪲 Fixes
|
|
33
36
|
|
|
34
|
-
|
|
35
|
-
[2025-02-03]
|
|
37
|
+
- fix: isEmpty and isNotEmpty rules adds error issue twice @Eray Hanoğlu
|
|
36
38
|
|
|
37
|
-
###
|
|
39
|
+
### [v5.13.2](https://github.com/panates/valgen/compare/v5.13.1...v5.13.2) - 15 March 2025
|
|
38
40
|
|
|
39
|
-
|
|
40
|
-
* refactor: Changed error messages to "positive sentences" ([`3b746df`](https://github.com/panates/valgen/commit/3b746df70ab0e25e32e3f5b957f1c24f3f0fcc70))
|
|
41
|
-
* chore: Updated github workflow ([`661738f`](https://github.com/panates/valgen/commit/661738f1fd90eed72ec2718e67159a8ab614e65e))
|
|
42
|
-
* dev: Fixed ts config ([`e3251ce`](https://github.com/panates/valgen/commit/e3251ce7776de3bd4afeb0c2d0ed5d19f6aabd4f))
|
|
43
|
-
* dev: Added missing script ([`dd019d9`](https://github.com/panates/valgen/commit/dd019d923f8305462e27cad1745564071c9c34bb))
|
|
41
|
+
#### 🪲 Fixes
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
[2024-11-04]
|
|
43
|
+
- fix: Fixed ignoring pipe validators if context.errors has items. @Eray Hanoğlu
|
|
47
44
|
|
|
48
|
-
###
|
|
45
|
+
### [v5.13.1](https://github.com/panates/valgen/compare/v5.13.0...v5.13.1) - 14 March 2025
|
|
49
46
|
|
|
50
|
-
|
|
47
|
+
#### 🪲 Fixes
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
|
|
49
|
+
- fix: Fixed validation of Date, Buffer and ArrayBuffer objects of isEmpty and isNotEmpty rules @Eray Hanoğlu
|
|
50
|
+
- fix: Fixed validation of Date, Buffer and ArrayBuffer objects of isEmpty and isNotEmpty rules @Eray Hanoğlu
|
|
54
51
|
|
|
55
|
-
###
|
|
52
|
+
### [v5.13.0](https://github.com/panates/valgen/compare/v5.12.0...v5.13.0) - 3 February 2025
|
|
56
53
|
|
|
57
|
-
|
|
54
|
+
#### 🛠 Refactoring and Updates
|
|
58
55
|
|
|
59
|
-
|
|
60
|
-
|
|
56
|
+
- refactor: Updated dependencies @Eray Hanoğlu
|
|
57
|
+
- refactor: Changed error messages to "positive sentences" @Eray Hanoğlu
|
|
61
58
|
|
|
62
|
-
|
|
59
|
+
#### 💬 General Changes
|
|
63
60
|
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
- dev: Fixed ts config @Eray Hanoğlu
|
|
62
|
+
- dev: Added missing script @Eray Hanoğlu
|
|
66
63
|
|
|
67
|
-
|
|
68
|
-
[2024-08-20]
|
|
64
|
+
### [v5.12.0](https://github.com/panates/valgen/compare/v5.11.0...v5.12.0) - 4 November 2024
|
|
69
65
|
|
|
70
|
-
|
|
66
|
+
#### 🛠 Refactoring and Updates
|
|
71
67
|
|
|
72
|
-
|
|
68
|
+
- refactor: Move from 'validator' library to "@browsery/validator" for ESM compatibility @Eray Hanoğlu
|
|
73
69
|
|
|
74
|
-
|
|
75
|
-
[2024-08-12]
|
|
70
|
+
### [v5.11.0](https://github.com/panates/valgen/compare/v5.10.0...v5.11.0) - 4 November 2024
|
|
76
71
|
|
|
77
|
-
|
|
72
|
+
#### 💬 General Changes
|
|
78
73
|
|
|
79
|
-
|
|
74
|
+
- nit: Updated dependencies @Eray Hanoğlu
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
[2024-08-12]
|
|
76
|
+
### [v5.10.0](https://github.com/panates/valgen/compare/v5.9.0...v5.10.0) - 14 September 2024
|
|
83
77
|
|
|
84
|
-
|
|
78
|
+
#### 💬 General Changes
|
|
85
79
|
|
|
86
|
-
|
|
80
|
+
- fixed: Circular imports @Eray Hanoğlu
|
|
87
81
|
|
|
88
|
-
|
|
89
|
-
[2024-08-12]
|
|
82
|
+
### [v5.9.0](https://github.com/panates/valgen/compare/v5.8.2...v5.9.0) - 20 August 2024
|
|
90
83
|
|
|
91
|
-
|
|
84
|
+
#### 💬 General Changes
|
|
92
85
|
|
|
93
|
-
|
|
86
|
+
- Fixed compatibility for "Node16" and "NodeNext" moduleResolution options @Eray Hanoğlu
|
|
94
87
|
|
|
95
|
-
|
|
96
|
-
[2024-08-09]
|
|
88
|
+
### [v5.8.2](https://github.com/panates/valgen/compare/v5.8.1...v5.8.2) - 12 August 2024
|
|
97
89
|
|
|
98
|
-
|
|
90
|
+
#### 💬 General Changes
|
|
99
91
|
|
|
100
|
-
|
|
92
|
+
- Applied publint to check package.json @Eray Hanoğlu
|
|
101
93
|
|
|
102
|
-
|
|
103
|
-
[2024-07-14]
|
|
94
|
+
### [v5.8.1](https://github.com/panates/valgen/compare/v5.8.0...v5.8.1) - 12 August 2024
|
|
104
95
|
|
|
105
|
-
|
|
96
|
+
#### 💬 General Changes
|
|
106
97
|
|
|
107
|
-
|
|
108
|
-
* Added isNotNull and isNotNullish rules ([`ff881d6`](https://github.com/panates/valgen/commit/ff881d6be81068c70e020109485b91854c355598))
|
|
98
|
+
- Applied publint to check package.json @Eray Hanoğlu
|
|
109
99
|
|
|
110
|
-
|
|
111
|
-
[2024-07-14]
|
|
100
|
+
### [v5.8.0](https://github.com/panates/valgen/compare/v5.7.0...v5.8.0) - 12 August 2024
|
|
112
101
|
|
|
113
|
-
|
|
102
|
+
#### 💬 General Changes
|
|
114
103
|
|
|
115
|
-
|
|
116
|
-
* Changed error message ([`3edf948`](https://github.com/panates/valgen/commit/3edf948a674d11a4ff5efcb97ca255b0723a11ca))
|
|
117
|
-
* Removed coercing of isNull and isNullish rules ([`4337d0a`](https://github.com/panates/valgen/commit/4337d0a4bd148718f33f744257b13afdd5c3ac50))
|
|
118
|
-
* Now pipe can return original input value when returnIndex = -1 ([`baf698c`](https://github.com/panates/valgen/commit/baf698c289254743d70ef815188f2300d7230f00))
|
|
104
|
+
- Rollback to ES2020 @Eray Hanoğlu
|
|
119
105
|
|
|
120
|
-
|
|
121
|
-
[2024-05-18]
|
|
106
|
+
### [v5.7.0](https://github.com/panates/valgen/compare/v5.6.0...v5.7.0) - 9 August 2024
|
|
122
107
|
|
|
123
|
-
|
|
108
|
+
#### 💬 General Changes
|
|
124
109
|
|
|
125
|
-
|
|
110
|
+
- Made ready for Node16 moduleResolution @Eray Hanoğlu
|
|
126
111
|
|
|
127
|
-
|
|
128
|
-
[2024-05-18]
|
|
112
|
+
### [v5.6.0](https://github.com/panates/valgen/compare/v5.5.0...v5.6.0) - 14 July 2024
|
|
129
113
|
|
|
130
|
-
|
|
114
|
+
#### 💬 General Changes
|
|
131
115
|
|
|
132
|
-
|
|
133
|
-
|
|
116
|
+
- Added isNotNull and isNotNullish rules @Eray Hanoğlu
|
|
117
|
+
- Added isNotNull and isNotNullish rules @Eray Hanoğlu
|
|
134
118
|
|
|
135
|
-
|
|
136
|
-
[2024-05-18]
|
|
119
|
+
### [v5.5.0](https://github.com/panates/valgen/compare/v5.4.1...v5.5.0) - 14 July 2024
|
|
137
120
|
|
|
138
|
-
|
|
121
|
+
#### 💬 General Changes
|
|
139
122
|
|
|
140
|
-
|
|
141
|
-
|
|
123
|
+
- Moved eslint config to @panates/eslint-config @Eray Hanoğlu
|
|
124
|
+
- Changed error message @Eray Hanoğlu
|
|
125
|
+
- Removed coercing of isNull and isNullish rules @Eray Hanoğlu
|
|
126
|
+
- Now pipe can return original input value when returnIndex = -1 @Eray Hanoğlu
|
|
142
127
|
|
|
143
|
-
|
|
144
|
-
[2024-05-18]
|
|
128
|
+
### [v5.4.1](https://github.com/panates/valgen/compare/v5.4.0...v5.4.1) - 18 May 2024
|
|
145
129
|
|
|
146
|
-
|
|
130
|
+
#### 💬 General Changes
|
|
147
131
|
|
|
148
|
-
|
|
149
|
-
* Updated code documentation ([`81e7ccf`](https://github.com/panates/valgen/commit/81e7ccf145075a0649cb7281062f422cd989dfa3))
|
|
150
|
-
* Fixed rule name ([`73d90d1`](https://github.com/panates/valgen/commit/73d90d14314d6d98d089c60134f05d651a2e4b0f))
|
|
132
|
+
- Exposed toBigint @Eray Hanoğlu
|
|
151
133
|
|
|
152
|
-
|
|
153
|
-
[2024-05-06]
|
|
134
|
+
### [v5.4.0](https://github.com/panates/valgen/compare/v5.3.2...v5.4.0) - 18 May 2024
|
|
154
135
|
|
|
155
|
-
|
|
136
|
+
#### 💬 General Changes
|
|
156
137
|
|
|
157
|
-
|
|
138
|
+
- Added returnIndex to pipe() @Eray Hanoğlu
|
|
139
|
+
- Updated circleci config @Eray Hanoğlu
|
|
158
140
|
|
|
159
|
-
|
|
160
|
-
[2024-03-29]
|
|
141
|
+
### [v5.3.2](https://github.com/panates/valgen/compare/v5.3.1...v5.3.2) - 18 May 2024
|
|
161
142
|
|
|
162
|
-
|
|
143
|
+
#### 💬 General Changes
|
|
163
144
|
|
|
164
|
-
|
|
165
|
-
|
|
145
|
+
- Updated dependencies @Eray Hanoğlu
|
|
146
|
+
- Fixed coveralls token @Eray Hanoğlu
|
|
166
147
|
|
|
167
|
-
|
|
168
|
-
[2024-03-27]
|
|
148
|
+
### [v5.3.1](https://github.com/panates/valgen/compare/v5.3.0...v5.3.1) - 18 May 2024
|
|
169
149
|
|
|
170
|
-
|
|
150
|
+
#### 💬 General Changes
|
|
171
151
|
|
|
172
|
-
|
|
152
|
+
- Reorganized many rules @Eray Hanoğlu
|
|
153
|
+
- Updated code documentation @Eray Hanoğlu
|
|
154
|
+
- Fixed rule name @Eray Hanoğlu
|
|
173
155
|
|
|
174
|
-
|
|
175
|
-
[2024-01-04]
|
|
156
|
+
### [v5.3.0](https://github.com/panates/valgen/compare/v5.2.2...v5.3.0) - 6 May 2024
|
|
176
157
|
|
|
177
|
-
|
|
158
|
+
#### 💬 General Changes
|
|
178
159
|
|
|
179
|
-
|
|
160
|
+
- Added validation generation option to enable coercing by default. @Eray Hanoğlu
|
|
180
161
|
|
|
181
|
-
|
|
182
|
-
[2023-12-23]
|
|
162
|
+
### [v5.2.2](https://github.com/panates/valgen/compare/v5.2.1...v5.2.2) - 29 March 2024
|
|
183
163
|
|
|
184
|
-
|
|
164
|
+
#### 💬 General Changes
|
|
185
165
|
|
|
186
|
-
|
|
166
|
+
- Updated dependencies @Eray Hanoğlu
|
|
167
|
+
- Updated dependencies @Eray Hanoğlu
|
|
187
168
|
|
|
188
|
-
|
|
189
|
-
[2023-12-23]
|
|
169
|
+
### [v5.2.1](https://github.com/panates/valgen/compare/v5.2.0...v5.2.1) - 27 March 2024
|
|
190
170
|
|
|
191
|
-
|
|
171
|
+
#### 💬 General Changes
|
|
192
172
|
|
|
193
|
-
|
|
194
|
-
* Moved all validator factories into "factories" namespace, ([`2ac5abd`](https://github.com/panates/valgen/commit/2ac5abd7f2097de4ec769bcc55034636142ee598))
|
|
173
|
+
- Updated dependencies @Eray Hanoğlu
|
|
195
174
|
|
|
196
|
-
|
|
197
|
-
[2023-12-21]
|
|
175
|
+
### [v5.2.0](https://github.com/panates/valgen/compare/v5.1.0...v5.2.0) - 4 January 2024
|
|
198
176
|
|
|
199
|
-
|
|
177
|
+
#### 💬 General Changes
|
|
200
178
|
|
|
201
|
-
|
|
179
|
+
- Now validator options persist in context @Eray Hanoğlu
|
|
202
180
|
|
|
203
|
-
|
|
204
|
-
[2023-12-08]
|
|
181
|
+
### [v5.1.0](https://github.com/panates/valgen/compare/v5.0.1...v5.1.0) - 23 December 2023
|
|
205
182
|
|
|
206
|
-
|
|
183
|
+
#### 💬 General Changes
|
|
207
184
|
|
|
208
|
-
|
|
209
|
-
* Pass "_this" parameter to preValidation and postValidation methods ([`bdb6a97`](https://github.com/panates/valgen/commit/bdb6a97ed50b538fad97ed1fb2161f8665647214))
|
|
185
|
+
- Moved from "dayjs" to "date-fns" @Eray Hanoğlu
|
|
210
186
|
|
|
211
|
-
|
|
212
|
-
[2023-12-04]
|
|
187
|
+
### [v5.0.1](https://github.com/panates/valgen/compare/v5.0.0...v5.0.1) - 23 December 2023
|
|
213
188
|
|
|
214
|
-
|
|
189
|
+
#### 💬 General Changes
|
|
215
190
|
|
|
216
|
-
|
|
191
|
+
- Added new rules @Eray Hanoğlu
|
|
192
|
+
- Moved all validator factories into "factories" namespace, @Eray Hanoğlu
|
|
217
193
|
|
|
218
|
-
|
|
219
|
-
[2023-12-02]
|
|
194
|
+
## [v5.0.0](https://github.com/panates/valgen/compare/v4.3.2...v5.0.0) - 21 December 2023
|
|
220
195
|
|
|
221
|
-
|
|
196
|
+
#### 💬 General Changes
|
|
222
197
|
|
|
223
|
-
|
|
224
|
-
* Added [preValidation] and [postValidation] to isObject rule ([`2f8351d`](https://github.com/panates/valgen/commit/2f8351d10fd1a9cc78577c52b37681319f3d28b2))
|
|
198
|
+
- Moved all validator factories into "factories" namespace, @Eray Hanoğlu
|
|
225
199
|
|
|
226
|
-
|
|
227
|
-
[2023-11-27]
|
|
200
|
+
### [v4.3.2](https://github.com/panates/valgen/compare/v4.3.1...v4.3.2) - 8 December 2023
|
|
228
201
|
|
|
229
|
-
|
|
202
|
+
#### 💬 General Changes
|
|
230
203
|
|
|
231
|
-
|
|
204
|
+
- Updated dependenices @Eray Hanoğlu
|
|
205
|
+
- Pass "_this" parameter to preValidation and postValidation methods @Eray Hanoğlu
|
|
232
206
|
|
|
233
|
-
|
|
234
|
-
[2023-11-20]
|
|
207
|
+
### [v4.3.1](https://github.com/panates/valgen/compare/v4.3.0...v4.3.1) - 4 December 2023
|
|
235
208
|
|
|
236
|
-
|
|
209
|
+
#### 💬 General Changes
|
|
237
210
|
|
|
238
|
-
|
|
211
|
+
- Made preValidation and postValidation static @Eray Hanoğlu
|
|
239
212
|
|
|
240
|
-
|
|
241
|
-
[2023-11-20]
|
|
213
|
+
### [v4.3.0](https://github.com/panates/valgen/compare/v4.2.5...v4.3.0) - 2 December 2023
|
|
242
214
|
|
|
243
|
-
|
|
215
|
+
#### 💬 General Changes
|
|
244
216
|
|
|
245
|
-
|
|
217
|
+
- Updated dependencies @Eray Hanoğlu
|
|
218
|
+
- Added [preValidation] and [postValidation] to isObject rule @Eray Hanoğlu
|
|
246
219
|
|
|
247
|
-
|
|
248
|
-
[2023-11-15]
|
|
220
|
+
### [v4.2.5](https://github.com/panates/valgen/compare/v4.2.4...v4.2.5) - 27 November 2023
|
|
249
221
|
|
|
250
|
-
|
|
222
|
+
#### 💬 General Changes
|
|
251
223
|
|
|
252
|
-
|
|
224
|
+
- Fixed isArray error location property. @Eray Hanoğlu
|
|
253
225
|
|
|
254
|
-
|
|
255
|
-
[2023-11-15]
|
|
226
|
+
### [v4.2.4](https://github.com/panates/valgen/compare/v4.2.3...v4.2.4) - 20 November 2023
|
|
256
227
|
|
|
257
|
-
|
|
228
|
+
#### 💬 General Changes
|
|
258
229
|
|
|
259
|
-
|
|
230
|
+
- Added json parsing feature to isObject validator @Eray Hanoğlu
|
|
260
231
|
|
|
261
|
-
|
|
262
|
-
[2023-11-15]
|
|
232
|
+
### [v4.2.3](https://github.com/panates/valgen/compare/v4.2.2...v4.2.3) - 20 November 2023
|
|
263
233
|
|
|
264
|
-
|
|
234
|
+
#### 💬 General Changes
|
|
265
235
|
|
|
266
|
-
|
|
267
|
-
* Added test for "label" option ([`162f41a`](https://github.com/panates/valgen/commit/162f41ac36762a146718c3efc4784bb33f48c955))
|
|
236
|
+
- Optimized error messages @Eray Hanoğlu
|
|
268
237
|
|
|
269
|
-
|
|
270
|
-
[2023-10-31]
|
|
238
|
+
### [v4.2.2](https://github.com/panates/valgen/compare/v4.2.1...v4.2.2) - 15 November 2023
|
|
271
239
|
|
|
272
|
-
|
|
240
|
+
#### 💬 General Changes
|
|
273
241
|
|
|
274
|
-
|
|
242
|
+
- Changed "trim" option @Eray Hanoğlu
|
|
275
243
|
|
|
276
|
-
|
|
277
|
-
[2023-10-24]
|
|
244
|
+
### [v4.2.1](https://github.com/panates/valgen/compare/v4.2.0...v4.2.1) - 15 November 2023
|
|
278
245
|
|
|
279
|
-
|
|
246
|
+
#### 💬 General Changes
|
|
280
247
|
|
|
281
|
-
|
|
248
|
+
- Fixed generating invalid date string @Eray Hanoğlu
|
|
282
249
|
|
|
283
|
-
|
|
284
|
-
[2023-08-17]
|
|
250
|
+
### [v4.2.0](https://github.com/panates/valgen/compare/v4.1.0...v4.2.0) - 15 November 2023
|
|
285
251
|
|
|
286
|
-
|
|
252
|
+
#### 💬 General Changes
|
|
287
253
|
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
254
|
+
- Removed "format" option and added "precision" option to isDate validator @Eray Hanoğlu
|
|
255
|
+
- Added test for "label" option @Eray Hanoğlu
|
|
256
|
+
|
|
257
|
+
### [v4.1.0](https://github.com/panates/valgen/compare/v4.0.1...v4.1.0) - 31 October 2023
|
|
258
|
+
|
|
259
|
+
#### 💬 General Changes
|
|
260
|
+
|
|
261
|
+
- Updated validation messages. @Eray Hanoğlu
|
|
262
|
+
|
|
263
|
+
### [v4.0.1](https://github.com/panates/valgen/compare/v4.0.0...v4.0.1) - 24 October 2023
|
|
264
|
+
|
|
265
|
+
#### 💬 General Changes
|
|
266
|
+
|
|
267
|
+
- Added "coerce" option to isNull and isUndefined rules @Eray Hanoğlu
|
|
268
|
+
|
|
269
|
+
## [v4.0.0](https://github.com/panates/valgen/compare/v3.2.1...v4.0.0) - 17 August 2023
|
|
270
|
+
|
|
271
|
+
#### 💬 General Changes
|
|
272
|
+
|
|
273
|
+
- Initial release of v4.0.0-alpha.1 @Eray Hanoğlu
|
|
274
|
+
- Implemented all initial validators and tests @Eray Hanoğlu
|
|
275
|
+
- Updated dependencies @Eray Hanoğlu
|
|
276
|
+
- Better error handling @Eray Hanoğlu
|
|
277
|
+
- Updated deps @Eray Hanoğlu
|
|
278
|
+
- Added isBigint validator @Eray Hanoğlu
|
|
279
|
+
- Fixed isObject coerce issue @Eray Hanoğlu
|
|
280
|
+
- Improved isDateString @Eray Hanoğlu
|
|
281
|
+
- Updated dayjs @Eray Hanoğlu
|
|
282
|
+
- Updated deps @Eray Hanoğlu
|
|
283
|
+
- Updated deps @Eray Hanoğlu
|
|
284
|
+
- Fixed isObject coerce issue @Eray Hanoğlu
|
package/cjs/constants.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.preValidation = exports.postValidation = void 0;
|
|
3
|
+
exports.VALIDATE_NESTED_METADATA = exports.VALIDATE_METADATA = exports.preValidation = exports.postValidation = void 0;
|
|
4
4
|
exports.postValidation = Symbol('postValidation');
|
|
5
5
|
exports.preValidation = Symbol('preValidation');
|
|
6
|
+
exports.VALIDATE_METADATA = Symbol('VALIDATE_METADATA');
|
|
7
|
+
exports.VALIDATE_NESTED_METADATA = Symbol('VALIDATE_NESTED_METADATA');
|
|
@@ -48,7 +48,7 @@ function isObject(schema, options) {
|
|
|
48
48
|
context.fail(_this, `Value must be an object`, input);
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const keys = [...Object.keys(output), ...schemaKeys];
|
|
51
|
+
const keys = Array.from(new Set([...Object.keys(output), ...schemaKeys]));
|
|
52
52
|
const l = keys.length;
|
|
53
53
|
let i = 0;
|
|
54
54
|
let inputKey;
|
|
@@ -102,8 +102,6 @@ function isObject(schema, options) {
|
|
|
102
102
|
out[propertyOptions[schemaKey]?.as || schemaKey] = v;
|
|
103
103
|
}
|
|
104
104
|
}
|
|
105
|
-
if (context.errors.length)
|
|
106
|
-
return undefined;
|
|
107
105
|
if (ctor && ctor[constants_js_1.postValidation]) {
|
|
108
106
|
ctor[constants_js_1.postValidation](out, context, _this);
|
|
109
107
|
return out;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../src/constants.ts","../../src/factories.ts","../../src/index.ts","../../src/core/constants.ts","../../src/core/context.ts","../../src/core/index.ts","../../src/core/types.ts","../../src/core/utilities.ts","../../src/core/validation-error.ts","../../src/core/validator.ts","../../src/helpers/object.utils.ts","../../src/helpers/omit-undefined.ts","../../src/helpers/string.utils.ts","../../src/rules/index.ts","../../src/rules/format-rules/is-alpha.ts","../../src/rules/format-rules/is-ascii.ts","../../src/rules/format-rules/is-base64.ts","../../src/rules/format-rules/is-btc-address.ts","../../src/rules/format-rules/is-credit-card.ts","../../src/rules/format-rules/is-decimal.ts","../../src/rules/format-rules/is-ean.ts","../../src/rules/format-rules/is-email.ts","../../src/rules/format-rules/is-eth-address.ts","../../src/rules/format-rules/is-fqdn.ts","../../src/rules/format-rules/is-hash.ts","../../src/rules/format-rules/is-hex-color.ts","../../src/rules/format-rules/is-hex.ts","../../src/rules/format-rules/is-iban.ts","../../src/rules/format-rules/is-ip.ts","../../src/rules/format-rules/is-issn.ts","../../src/rules/format-rules/is-jwt.ts","../../src/rules/format-rules/is-lowercase.ts","../../src/rules/format-rules/is-mac-address.ts","../../src/rules/format-rules/is-mobile-phone.ts","../../src/rules/format-rules/is-object-id.ts","../../src/rules/format-rules/is-passport-number.ts","../../src/rules/format-rules/is-port.ts","../../src/rules/format-rules/is-url.ts","../../src/rules/format-rules/is-uuid.ts","../../src/rules/format-rules/is-vat-number.ts","../../src/rules/format-rules/matches.ts","../../src/rules/logical-rules/is-defined.ts","../../src/rules/logical-rules/is-empty.ts","../../src/rules/logical-rules/range.ts","../../src/rules/type-rules/is-any.ts","../../src/rules/type-rules/is-array.ts","../../src/rules/type-rules/is-bigint.ts","../../src/rules/type-rules/is-boolean.ts","../../src/rules/type-rules/is-date.ts","../../src/rules/type-rules/is-enum.ts","../../src/rules/type-rules/is-integer.ts","../../src/rules/type-rules/is-null.ts","../../src/rules/type-rules/is-number.ts","../../src/rules/type-rules/is-object.ts","../../src/rules/type-rules/is-record.ts","../../src/rules/type-rules/is-string.ts","../../src/rules/type-rules/is-tuple.ts","../../src/rules/type-rules/is-undefined.ts","../../src/rules/utility-rules/exists.ts","../../src/rules/utility-rules/get-length.ts","../../src/rules/utility-rules/optional.ts","../../src/rules/utility-rules/pipe.ts","../../src/rules/utility-rules/required.ts","../../src/rules/utility-rules/union.ts"],"version":"5.8.
|
|
1
|
+
{"root":["../../src/constants.ts","../../src/factories.ts","../../src/index.ts","../../src/core/constants.ts","../../src/core/context.ts","../../src/core/index.ts","../../src/core/types.ts","../../src/core/utilities.ts","../../src/core/validation-error.ts","../../src/core/validator.ts","../../src/helpers/object.utils.ts","../../src/helpers/omit-undefined.ts","../../src/helpers/string.utils.ts","../../src/rules/index.ts","../../src/rules/format-rules/is-alpha.ts","../../src/rules/format-rules/is-ascii.ts","../../src/rules/format-rules/is-base64.ts","../../src/rules/format-rules/is-btc-address.ts","../../src/rules/format-rules/is-credit-card.ts","../../src/rules/format-rules/is-decimal.ts","../../src/rules/format-rules/is-ean.ts","../../src/rules/format-rules/is-email.ts","../../src/rules/format-rules/is-eth-address.ts","../../src/rules/format-rules/is-fqdn.ts","../../src/rules/format-rules/is-hash.ts","../../src/rules/format-rules/is-hex-color.ts","../../src/rules/format-rules/is-hex.ts","../../src/rules/format-rules/is-iban.ts","../../src/rules/format-rules/is-ip.ts","../../src/rules/format-rules/is-issn.ts","../../src/rules/format-rules/is-jwt.ts","../../src/rules/format-rules/is-lowercase.ts","../../src/rules/format-rules/is-mac-address.ts","../../src/rules/format-rules/is-mobile-phone.ts","../../src/rules/format-rules/is-object-id.ts","../../src/rules/format-rules/is-passport-number.ts","../../src/rules/format-rules/is-port.ts","../../src/rules/format-rules/is-url.ts","../../src/rules/format-rules/is-uuid.ts","../../src/rules/format-rules/is-vat-number.ts","../../src/rules/format-rules/matches.ts","../../src/rules/logical-rules/is-defined.ts","../../src/rules/logical-rules/is-empty.ts","../../src/rules/logical-rules/range.ts","../../src/rules/type-rules/is-any.ts","../../src/rules/type-rules/is-array.ts","../../src/rules/type-rules/is-bigint.ts","../../src/rules/type-rules/is-boolean.ts","../../src/rules/type-rules/is-date.ts","../../src/rules/type-rules/is-enum.ts","../../src/rules/type-rules/is-integer.ts","../../src/rules/type-rules/is-null.ts","../../src/rules/type-rules/is-number.ts","../../src/rules/type-rules/is-object.ts","../../src/rules/type-rules/is-record.ts","../../src/rules/type-rules/is-string.ts","../../src/rules/type-rules/is-tuple.ts","../../src/rules/type-rules/is-undefined.ts","../../src/rules/utility-rules/exists.ts","../../src/rules/utility-rules/get-length.ts","../../src/rules/utility-rules/optional.ts","../../src/rules/utility-rules/pipe.ts","../../src/rules/utility-rules/required.ts","../../src/rules/utility-rules/union.ts"],"version":"5.8.3"}
|
package/esm/constants.js
CHANGED
|
@@ -45,7 +45,7 @@ export function isObject(schema, options) {
|
|
|
45
45
|
context.fail(_this, `Value must be an object`, input);
|
|
46
46
|
return;
|
|
47
47
|
}
|
|
48
|
-
const keys = [...Object.keys(output), ...schemaKeys];
|
|
48
|
+
const keys = Array.from(new Set([...Object.keys(output), ...schemaKeys]));
|
|
49
49
|
const l = keys.length;
|
|
50
50
|
let i = 0;
|
|
51
51
|
let inputKey;
|
|
@@ -99,8 +99,6 @@ export function isObject(schema, options) {
|
|
|
99
99
|
out[propertyOptions[schemaKey]?.as || schemaKey] = v;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
|
-
if (context.errors.length)
|
|
103
|
-
return undefined;
|
|
104
102
|
if (ctor && ctor[postValidation]) {
|
|
105
103
|
ctor[postValidation](out, context, _this);
|
|
106
104
|
return out;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../../src/constants.ts","../../src/factories.ts","../../src/index.ts","../../src/core/constants.ts","../../src/core/context.ts","../../src/core/index.ts","../../src/core/types.ts","../../src/core/utilities.ts","../../src/core/validation-error.ts","../../src/core/validator.ts","../../src/helpers/object.utils.ts","../../src/helpers/omit-undefined.ts","../../src/helpers/string.utils.ts","../../src/rules/index.ts","../../src/rules/format-rules/is-alpha.ts","../../src/rules/format-rules/is-ascii.ts","../../src/rules/format-rules/is-base64.ts","../../src/rules/format-rules/is-btc-address.ts","../../src/rules/format-rules/is-credit-card.ts","../../src/rules/format-rules/is-decimal.ts","../../src/rules/format-rules/is-ean.ts","../../src/rules/format-rules/is-email.ts","../../src/rules/format-rules/is-eth-address.ts","../../src/rules/format-rules/is-fqdn.ts","../../src/rules/format-rules/is-hash.ts","../../src/rules/format-rules/is-hex-color.ts","../../src/rules/format-rules/is-hex.ts","../../src/rules/format-rules/is-iban.ts","../../src/rules/format-rules/is-ip.ts","../../src/rules/format-rules/is-issn.ts","../../src/rules/format-rules/is-jwt.ts","../../src/rules/format-rules/is-lowercase.ts","../../src/rules/format-rules/is-mac-address.ts","../../src/rules/format-rules/is-mobile-phone.ts","../../src/rules/format-rules/is-object-id.ts","../../src/rules/format-rules/is-passport-number.ts","../../src/rules/format-rules/is-port.ts","../../src/rules/format-rules/is-url.ts","../../src/rules/format-rules/is-uuid.ts","../../src/rules/format-rules/is-vat-number.ts","../../src/rules/format-rules/matches.ts","../../src/rules/logical-rules/is-defined.ts","../../src/rules/logical-rules/is-empty.ts","../../src/rules/logical-rules/range.ts","../../src/rules/type-rules/is-any.ts","../../src/rules/type-rules/is-array.ts","../../src/rules/type-rules/is-bigint.ts","../../src/rules/type-rules/is-boolean.ts","../../src/rules/type-rules/is-date.ts","../../src/rules/type-rules/is-enum.ts","../../src/rules/type-rules/is-integer.ts","../../src/rules/type-rules/is-null.ts","../../src/rules/type-rules/is-number.ts","../../src/rules/type-rules/is-object.ts","../../src/rules/type-rules/is-record.ts","../../src/rules/type-rules/is-string.ts","../../src/rules/type-rules/is-tuple.ts","../../src/rules/type-rules/is-undefined.ts","../../src/rules/utility-rules/exists.ts","../../src/rules/utility-rules/get-length.ts","../../src/rules/utility-rules/optional.ts","../../src/rules/utility-rules/pipe.ts","../../src/rules/utility-rules/required.ts","../../src/rules/utility-rules/union.ts"],"version":"5.8.
|
|
1
|
+
{"root":["../../src/constants.ts","../../src/factories.ts","../../src/index.ts","../../src/core/constants.ts","../../src/core/context.ts","../../src/core/index.ts","../../src/core/types.ts","../../src/core/utilities.ts","../../src/core/validation-error.ts","../../src/core/validator.ts","../../src/helpers/object.utils.ts","../../src/helpers/omit-undefined.ts","../../src/helpers/string.utils.ts","../../src/rules/index.ts","../../src/rules/format-rules/is-alpha.ts","../../src/rules/format-rules/is-ascii.ts","../../src/rules/format-rules/is-base64.ts","../../src/rules/format-rules/is-btc-address.ts","../../src/rules/format-rules/is-credit-card.ts","../../src/rules/format-rules/is-decimal.ts","../../src/rules/format-rules/is-ean.ts","../../src/rules/format-rules/is-email.ts","../../src/rules/format-rules/is-eth-address.ts","../../src/rules/format-rules/is-fqdn.ts","../../src/rules/format-rules/is-hash.ts","../../src/rules/format-rules/is-hex-color.ts","../../src/rules/format-rules/is-hex.ts","../../src/rules/format-rules/is-iban.ts","../../src/rules/format-rules/is-ip.ts","../../src/rules/format-rules/is-issn.ts","../../src/rules/format-rules/is-jwt.ts","../../src/rules/format-rules/is-lowercase.ts","../../src/rules/format-rules/is-mac-address.ts","../../src/rules/format-rules/is-mobile-phone.ts","../../src/rules/format-rules/is-object-id.ts","../../src/rules/format-rules/is-passport-number.ts","../../src/rules/format-rules/is-port.ts","../../src/rules/format-rules/is-url.ts","../../src/rules/format-rules/is-uuid.ts","../../src/rules/format-rules/is-vat-number.ts","../../src/rules/format-rules/matches.ts","../../src/rules/logical-rules/is-defined.ts","../../src/rules/logical-rules/is-empty.ts","../../src/rules/logical-rules/range.ts","../../src/rules/type-rules/is-any.ts","../../src/rules/type-rules/is-array.ts","../../src/rules/type-rules/is-bigint.ts","../../src/rules/type-rules/is-boolean.ts","../../src/rules/type-rules/is-date.ts","../../src/rules/type-rules/is-enum.ts","../../src/rules/type-rules/is-integer.ts","../../src/rules/type-rules/is-null.ts","../../src/rules/type-rules/is-number.ts","../../src/rules/type-rules/is-object.ts","../../src/rules/type-rules/is-record.ts","../../src/rules/type-rules/is-string.ts","../../src/rules/type-rules/is-tuple.ts","../../src/rules/type-rules/is-undefined.ts","../../src/rules/utility-rules/exists.ts","../../src/rules/utility-rules/get-length.ts","../../src/rules/utility-rules/optional.ts","../../src/rules/utility-rules/pipe.ts","../../src/rules/utility-rules/required.ts","../../src/rules/utility-rules/union.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valgen",
|
|
3
3
|
"description": "Fast runtime type validator, converter and io (encoding/decoding) library",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.14.1",
|
|
5
5
|
"author": "Panates",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"dependencies": {
|
|
8
8
|
"@browsery/validator": "^13.12.0-r3",
|
|
9
9
|
"date-fns": "^4.1.0",
|
|
10
|
+
"reflect-metadata": "^0.2.2",
|
|
10
11
|
"ts-gems": "^3.11.3",
|
|
11
12
|
"tslib": "^2.8.1"
|
|
12
13
|
},
|
|
@@ -58,5 +59,8 @@
|
|
|
58
59
|
"converter",
|
|
59
60
|
"transform",
|
|
60
61
|
"type"
|
|
61
|
-
]
|
|
62
|
+
],
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
65
|
+
}
|
|
62
66
|
}
|
package/types/constants.d.ts
CHANGED
package/types/core/index.d.ts
CHANGED
package/types/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vg from './rules/index.js';
|
|
2
2
|
export * from './constants.js';
|
|
3
3
|
export * from './core/index.js';
|
|
4
|
-
export { IsObject } from './rules/type-rules/is-object.js';
|
|
4
|
+
export type { IsObject } from './rules/type-rules/is-object.js';
|
|
5
5
|
declare const isAny: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
6
6
|
declare const isArray: import("./core/validator.js").Validator<unknown[], unknown, import("./core/types.js").ExecutionOptions>;
|
|
7
7
|
declare const isBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|
package/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as vg from './rules/index.js';
|
|
2
2
|
export * from './constants.js';
|
|
3
3
|
export * from './core/index.js';
|
|
4
|
-
export { IsObject } from './rules/type-rules/is-object.js';
|
|
4
|
+
export type { IsObject } from './rules/type-rules/is-object.js';
|
|
5
5
|
declare const isAny: import("./core/validator.js").Validator<any, any, import("./core/types.js").ExecutionOptions>;
|
|
6
6
|
declare const isArray: import("./core/validator.js").Validator<unknown[], unknown, import("./core/types.js").ExecutionOptions>;
|
|
7
7
|
declare const isBigint: import("./core/validator.js").Validator<bigint, unknown, import("./core/types.js").ExecutionOptions>;
|