@nr1e/commons 0.0.3-alpha.14 → 0.0.3-alpha.15

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.
Files changed (42) hide show
  1. package/package.json +7 -7
  2. package/LICENSE +0 -26
  3. package/README.md +0 -14
  4. package/dist/bitsnbytes/b64.d.ts +0 -39
  5. package/dist/bitsnbytes/b64.js +0 -130
  6. package/dist/bitsnbytes/b64.js.map +0 -1
  7. package/dist/bitsnbytes/index.d.ts +0 -1
  8. package/dist/bitsnbytes/index.js +0 -2
  9. package/dist/bitsnbytes/index.js.map +0 -1
  10. package/dist/errors/errors.d.ts +0 -160
  11. package/dist/errors/errors.js +0 -230
  12. package/dist/errors/errors.js.map +0 -1
  13. package/dist/errors/index.d.ts +0 -1
  14. package/dist/errors/index.js +0 -2
  15. package/dist/errors/index.js.map +0 -1
  16. package/dist/http/http-method.d.ts +0 -9
  17. package/dist/http/http-method.js +0 -11
  18. package/dist/http/http-method.js.map +0 -1
  19. package/dist/http/http-status-code.d.ts +0 -42
  20. package/dist/http/http-status-code.js +0 -44
  21. package/dist/http/http-status-code.js.map +0 -1
  22. package/dist/http/index.d.ts +0 -2
  23. package/dist/http/index.js +0 -3
  24. package/dist/http/index.js.map +0 -1
  25. package/dist/index.d.ts +0 -5
  26. package/dist/index.js +0 -6
  27. package/dist/index.js.map +0 -1
  28. package/dist/lang/index.d.ts +0 -2
  29. package/dist/lang/index.js +0 -3
  30. package/dist/lang/index.js.map +0 -1
  31. package/dist/lang/sleep.d.ts +0 -6
  32. package/dist/lang/sleep.js +0 -9
  33. package/dist/lang/sleep.js.map +0 -1
  34. package/dist/lang/type-functions.d.ts +0 -3
  35. package/dist/lang/type-functions.js +0 -10
  36. package/dist/lang/type-functions.js.map +0 -1
  37. package/dist/validator/index.d.ts +0 -1
  38. package/dist/validator/index.js +0 -2
  39. package/dist/validator/index.js.map +0 -1
  40. package/dist/validator/validators.d.ts +0 -188
  41. package/dist/validator/validators.js +0 -302
  42. package/dist/validator/validators.js.map +0 -1
@@ -1,302 +0,0 @@
1
- import { ValidationError } from '../errors';
2
- /**
3
- * Tests if a value is null or undefined.
4
- *
5
- * @param o the value to check
6
- */
7
- export function isNotNull(o) {
8
- return o !== undefined && o !== null;
9
- }
10
- /**
11
- * Throws a ValidationError if the value is null or undefined.
12
- * This function also asserts the value to be NonNullable if the check passes.
13
- *
14
- * @param name the name of the variable
15
- * @param o the value to check
16
- */
17
- export function notNull(name, o) {
18
- if (!isNotNull(o)) {
19
- throw new ValidationError(`${name} may not be null or undefined`);
20
- }
21
- }
22
- /**
23
- * Tests if a value is empty, null, undefined or has a length of 0.
24
- *
25
- * @param o the value to check
26
- */
27
- export function isNotEmpty(o) {
28
- return !(o === undefined || o === null || o.toString().length === 0);
29
- }
30
- /**
31
- * Throws a ValidationError if the value is null, undefined or the length is 0.
32
- * This function also asserts the value to be NonNullable if the check passes.
33
- *
34
- * @param name the name of the variable
35
- * @param o the value to check
36
- */
37
- export function notEmpty(name, o) {
38
- if (!isNotEmpty(o)) {
39
- throw new ValidationError(`${name} may not be empty`);
40
- }
41
- }
42
- /**
43
- * Tests if a value is null, undefined, has a length of 0 or contains only whitespace.
44
- *
45
- * @param o the value to check
46
- */
47
- export function isNotBlank(o) {
48
- return !(o === undefined || o === null || o.toString().trim().length === 0);
49
- }
50
- /**
51
- * Throws a ValidationError if the value is null, undefined, has a length of 0 or contains only whitespace.
52
- * This function also asserts the value to be NonNullable if the check passes.
53
- *
54
- * @param name the name of the variable
55
- * @param o the value to check
56
- */
57
- export function notBlank(name, o) {
58
- if (!isNotBlank(o)) {
59
- throw new ValidationError(`${name} may not be blank`);
60
- }
61
- }
62
- /**
63
- * Tests if a value does not match the regular expression provided.
64
- * Undefined and null values are skipped and not tested.
65
- *
66
- * @param regex the regular expression to test with
67
- * @param o the value to check
68
- */
69
- export function isMatch(regex, o) {
70
- if (o === undefined || o === null) {
71
- return true;
72
- }
73
- return o.match(regex) !== null;
74
- }
75
- /**
76
- * Throws a ValidationError if the value matches the regular expression provided.
77
- * Undefined and null values are skipped and not validated.
78
- *
79
- * @param name the name of the variable
80
- * @param regex the regular expression to validate with
81
- * @param o the value to check
82
- */
83
- export function match(name, regex, o) {
84
- if (!isMatch(regex, o)) {
85
- throw new ValidationError(`${name} must match ${regex}`);
86
- }
87
- }
88
- /**
89
- * Tests if a value is a valid email address.
90
- * Undefined and null values are skipped and not validated.
91
- *
92
- * @param o the value to check
93
- */
94
- export function isEmail(o) {
95
- const expression = /^(?=.{1,254}$)(?=.{1,64}@)[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+(\.[-!#$%&'*+/0-9=?A-Z^_`a-z{|}~]+)*@[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0-9-]{0,61}[A-Za-z0-9])?)*$/;
96
- return !(o !== undefined && o !== null && !expression.test(o));
97
- }
98
- /**
99
- * Throws a ValidationError if the value provided is not an email.
100
- * Undefined and null values are skipped and not validated.
101
- *
102
- * @param name the name of the variable
103
- * @param o the value to check
104
- */
105
- export function email(name, o) {
106
- if (!isEmail(o)) {
107
- throw new ValidationError(`${name} is not a valid email address`);
108
- }
109
- }
110
- /**
111
- * Tests if a value has a length that is less than the provided length.
112
- * Undefined and null values are skipped and not validated.
113
- *
114
- * @param length the maximum length of the variable
115
- * @param o the value to check
116
- */
117
- export function isMaxLength(length, o) {
118
- return !(o !== undefined && o !== null && o.length > length);
119
- }
120
- /**
121
- * Throws a ValidationError if the value provided has a length that exceeds the provided length.
122
- * Undefined and null values are skipped and not validated.
123
- *
124
- * @param name the name of the variable
125
- * @param length the maximum length of the variable
126
- * @param o the value to check
127
- */
128
- export function maxLength(name, length, o) {
129
- if (!isMaxLength(length, o)) {
130
- throw new ValidationError(`length of ${name} may not exceed ${length}`);
131
- }
132
- }
133
- /**
134
- * Tests if a value has a length that is greater than the provided length.
135
- * Undefined and null values are skipped and not validated.
136
- *
137
- * @param length the minimum length of the variable
138
- * @param o the value to check
139
- */
140
- export function isMinLength(length, o) {
141
- return !(o !== undefined && o !== null && o.length < length);
142
- }
143
- /**
144
- * Throws a ValidationError if the value provided has a length that is less than the provided length.
145
- * Undefined and null values are skipped and not validated.
146
- *
147
- * @param name the name of the variable
148
- * @param length the minimum length of the variable
149
- * @param o the value to check
150
- */
151
- export function minLength(name, length, o) {
152
- if (!isMinLength(length, o)) {
153
- throw new ValidationError(`length of ${name} may not be less than ${length}`);
154
- }
155
- }
156
- /**
157
- * Tests if a value provided is a number.
158
- * Undefined and null values are skipped and not validated.
159
- *
160
- * @param o the value to check
161
- */
162
- export function isNumber(o) {
163
- return o === undefined || o === null || !isNaN(+o);
164
- }
165
- /**
166
- * Throws a ValidationError if the value provided is not a number.
167
- * Undefined and null values are skipped and not validated.
168
- *
169
- * @param name the name of the variable
170
- * @param o the value to check
171
- */
172
- export function number(name, o) {
173
- if (!isNumber(o)) {
174
- throw new ValidationError(`${name} is not a number`);
175
- }
176
- }
177
- /**
178
- * Tests if a value is less than the provided minimum value.
179
- * Undefined and null values are skipped and not validated.
180
- *
181
- * @param minValue the minimum value allowed
182
- * @param o the value to check
183
- */
184
- export function isMinValue(minValue, o) {
185
- return o === undefined || o === null || +o >= minValue;
186
- }
187
- /**
188
- * Throws a ValidationError if the value is less than the provided minimum value.
189
- * Undefined and null values are skipped and not validated.
190
- *
191
- * @param name the name of the variable
192
- * @param minValue the minimum value allowed
193
- * @param o the value to check
194
- */
195
- export function minValue(name, minValue, o) {
196
- if (!isMinValue(minValue, o)) {
197
- throw new ValidationError(`${name} may not be less than ${minValue}`);
198
- }
199
- }
200
- /**
201
- * Tests if a value is more than the provided maximum value.
202
- * Undefined and null values are skipped and not validated.
203
- *
204
- * @param maxValue the maximum value allowed
205
- * @param o the value to check
206
- */
207
- export function isMaxValue(maxValue, o) {
208
- return !(o !== undefined && o !== null && +o > maxValue);
209
- }
210
- /**
211
- * Throws a ValidationError if the value is more than the provided maximum value.
212
- * Undefined and null values are skipped and not validated.
213
- *
214
- * @param name the name of the variable
215
- * @param maxValue the maximum value allowed
216
- * @param o the value to check
217
- */
218
- export function maxValue(name, maxValue, o) {
219
- if (!isMaxValue(maxValue, o)) {
220
- throw new ValidationError(`${name} may not be greater than ${maxValue}`);
221
- }
222
- }
223
- /**
224
- * Tests if the value is between the provided minimum and maximum values inclusive.
225
- * Undefined and null values are skipped and not validated.
226
- *
227
- * @param minValue the minimum value allowed
228
- * @param maxValue the maximum value allowed
229
- * @param o the value to check
230
- */
231
- export function isBetweenValues(minValue, maxValue, o) {
232
- return !(o !== undefined && o !== null && (+o < minValue || +o > maxValue));
233
- }
234
- /**
235
- * Throws a ValidationError if the value is not between the provided minimum and maximum values inclusive.
236
- * Undefined and null values are skipped and not validated.
237
- *
238
- * @param name the name of the variable
239
- * @param minValue the minimum value allowed
240
- * @param maxValue the maximum value allowed
241
- * @param o the value to check
242
- */
243
- export function betweenValues(name, minValue, maxValue, o) {
244
- if (!isBetweenValues(minValue, maxValue, o)) {
245
- throw new ValidationError(`${name} must be between ${minValue} and ${maxValue}`);
246
- }
247
- }
248
- const isString = (value) => typeof value === 'string';
249
- export function isValidString(options, value) {
250
- if (options.required) {
251
- if (!isNotNull(value)) {
252
- return false;
253
- }
254
- }
255
- else if (value === undefined || value === null) {
256
- return true;
257
- }
258
- if (!isString(value)) {
259
- return false;
260
- }
261
- if (options.minLength && !isMinLength(options.minLength, value)) {
262
- return false;
263
- }
264
- if (options.maxLength && !isMaxLength(options.maxLength, value)) {
265
- return false;
266
- }
267
- if (options.regex && !isMatch(options.regex, value)) {
268
- return false;
269
- }
270
- if (options.notBlank && !isNotBlank(value)) {
271
- return false;
272
- }
273
- if (options.notEmpty && !isNotEmpty(value)) {
274
- return false;
275
- }
276
- if (options.email && !isEmail(value)) {
277
- return false;
278
- }
279
- if (options.number && !isNumber(value)) {
280
- return false;
281
- }
282
- return true;
283
- }
284
- export function validString(name, options, value) {
285
- if (options.required) {
286
- notNull(name, value);
287
- }
288
- else if (value === undefined || value === null) {
289
- return;
290
- }
291
- if (!isString(value)) {
292
- throw new ValidationError(`${name} must be a string`);
293
- }
294
- options.minLength && minLength(name, options.minLength, value);
295
- options.maxLength && maxLength(name, options.maxLength, value);
296
- options.regex && match(name, options.regex, value);
297
- options.notBlank && notBlank(name, value);
298
- options.notEmpty && notEmpty(name, value);
299
- options.email && email(name, value);
300
- options.number && number(name, value);
301
- }
302
- //# sourceMappingURL=validators.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"validators.js","sourceRoot":"","sources":["../../src/validator/validators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,eAAe,EAAC,MAAM,WAAW,CAAC;AAE1C;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,CAAW;IACnC,OAAO,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,CAAC;AACvC,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,OAAO,CACrB,IAAY,EACZ,CAAW;IAEX,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE;QACjB,MAAM,IAAI,eAAe,CAAC,GAAG,IAAI,+BAA+B,CAAC,CAAC;KACnE;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,CAAW;IACpC,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;AACvE,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,QAAQ,CACtB,IAAY,EACZ,CAAW;IAEX,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,EAAE;QAClB,MAAM,IAAI,eAAe,CAAC,GAAG,IAAI,mBAAmB,CAAC,CAAC;KACvD;AACH,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,CAAW;IACpC,OAAO,CAAC,CAAC,CAAC,KAAK,SAAS,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