preconditions 4.0.3 → 4.0.4
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 +6 -6
- package/api.md +233 -233
- package/lib/preconditions.js +1 -1
- package/package.json +2 -2
- package/test.js +1 -0
package/api.md
CHANGED
|
@@ -97,7 +97,7 @@ Use this interface if you want to utilize the following functionality:
|
|
|
97
97
|
### instanceValidator.shouldBeDefined(configPath, [message]) ⇒ <code>this</code>
|
|
98
98
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is defined.
|
|
99
99
|
|
|
100
|
-
**Kind**: instance method of <code>
|
|
100
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
101
101
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
102
102
|
|
|
103
103
|
| Param | Type | Description |
|
|
@@ -110,7 +110,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
110
110
|
### instanceValidator.shouldBeUndefined(configPath, [message]) ⇒ <code>this</code>
|
|
111
111
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not defined.
|
|
112
112
|
|
|
113
|
-
**Kind**: instance method of <code>
|
|
113
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
114
114
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
115
115
|
|
|
116
116
|
| Param | Type | Description |
|
|
@@ -123,7 +123,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
123
123
|
### instanceValidator.shouldBeNonEmptyArray(configPath, [message]) ⇒ <code>this</code>
|
|
124
124
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not an array or is an empty array.
|
|
125
125
|
|
|
126
|
-
**Kind**: instance method of <code>
|
|
126
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
127
127
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
128
128
|
|
|
129
129
|
| Param | Type | Description |
|
|
@@ -136,7 +136,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
136
136
|
### instanceValidator.shouldBeArray(configPath, [message]) ⇒ <code>this</code>
|
|
137
137
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is an array.
|
|
138
138
|
|
|
139
|
-
**Kind**: instance method of <code>
|
|
139
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
140
140
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
141
141
|
|
|
142
142
|
| Param | Type | Description |
|
|
@@ -149,7 +149,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
149
149
|
### instanceValidator.shouldNotBeArray(configPath, [message]) ⇒ <code>this</code>
|
|
150
150
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not an array.
|
|
151
151
|
|
|
152
|
-
**Kind**: instance method of <code>
|
|
152
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
153
153
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
154
154
|
|
|
155
155
|
| Param | Type | Description |
|
|
@@ -162,7 +162,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
162
162
|
### instanceValidator.shouldBeObject(configPath, [message]) ⇒ <code>this</code>
|
|
163
163
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is of type Object.
|
|
164
164
|
|
|
165
|
-
**Kind**: instance method of <code>
|
|
165
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
166
166
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
167
167
|
|
|
168
168
|
| Param | Type | Description |
|
|
@@ -175,7 +175,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
175
175
|
### instanceValidator.shouldNotBeObject(configPath, [message]) ⇒ <code>this</code>
|
|
176
176
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not of type Object.
|
|
177
177
|
|
|
178
|
-
**Kind**: instance method of <code>
|
|
178
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
179
179
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
180
180
|
|
|
181
181
|
| Param | Type | Description |
|
|
@@ -188,7 +188,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
188
188
|
### instanceValidator.shouldBeEmpty(configPath, [message]) ⇒ <code>this</code>
|
|
189
189
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not empty.
|
|
190
190
|
|
|
191
|
-
**Kind**: instance method of <code>
|
|
191
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
192
192
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
193
193
|
|
|
194
194
|
| Param | Type | Description |
|
|
@@ -201,7 +201,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
201
201
|
### instanceValidator.shouldNotBeEmpty(configPath, [message]) ⇒ <code>this</code>
|
|
202
202
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is empty.
|
|
203
203
|
|
|
204
|
-
**Kind**: instance method of <code>
|
|
204
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
205
205
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
206
206
|
|
|
207
207
|
| Param | Type | Description |
|
|
@@ -214,7 +214,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
214
214
|
### instanceValidator.shouldBeFunction(configPath, [message]) ⇒ <code>this</code>
|
|
215
215
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not of type Function.
|
|
216
216
|
|
|
217
|
-
**Kind**: instance method of <code>
|
|
217
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
218
218
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
219
219
|
|
|
220
220
|
| Param | Type | Description |
|
|
@@ -227,7 +227,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
227
227
|
### instanceValidator.shouldNotBeFunction(configPath, [message]) ⇒ <code>this</code>
|
|
228
228
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is of type Function.
|
|
229
229
|
|
|
230
|
-
**Kind**: instance method of <code>
|
|
230
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
231
231
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
232
232
|
|
|
233
233
|
| Param | Type | Description |
|
|
@@ -240,7 +240,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
240
240
|
### instanceValidator.shouldBeString(configPath, [message]) ⇒ <code>this</code>
|
|
241
241
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not of type String.
|
|
242
242
|
|
|
243
|
-
**Kind**: instance method of <code>
|
|
243
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
244
244
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
245
245
|
|
|
246
246
|
| Param | Type | Description |
|
|
@@ -253,7 +253,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
253
253
|
### instanceValidator.shouldNotBeString(configPath, [message]) ⇒ <code>this</code>
|
|
254
254
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is of type String.
|
|
255
255
|
|
|
256
|
-
**Kind**: instance method of <code>
|
|
256
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
257
257
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
258
258
|
|
|
259
259
|
| Param | Type | Description |
|
|
@@ -266,7 +266,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
266
266
|
### instanceValidator.shouldBeNumber(configPath, [message]) ⇒ <code>this</code>
|
|
267
267
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not of type Number.
|
|
268
268
|
|
|
269
|
-
**Kind**: instance method of <code>
|
|
269
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
270
270
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
271
271
|
|
|
272
272
|
| Param | Type | Description |
|
|
@@ -279,7 +279,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
279
279
|
### instanceValidator.shouldNotBeNumber(configPath, [message]) ⇒ <code>this</code>
|
|
280
280
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is of type Number.
|
|
281
281
|
|
|
282
|
-
**Kind**: instance method of <code>
|
|
282
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
283
283
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
284
284
|
|
|
285
285
|
| Param | Type | Description |
|
|
@@ -292,7 +292,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
292
292
|
### instanceValidator.shouldBeFinite(configPath, [message]) ⇒ <code>this</code>
|
|
293
293
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not finite.
|
|
294
294
|
|
|
295
|
-
**Kind**: instance method of <code>
|
|
295
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
296
296
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
297
297
|
|
|
298
298
|
| Param | Type | Description |
|
|
@@ -305,7 +305,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
305
305
|
### instanceValidator.shouldBeInfinite(configPath, [message]) ⇒ <code>this</code>
|
|
306
306
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not infinte.
|
|
307
307
|
|
|
308
|
-
**Kind**: instance method of <code>
|
|
308
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
309
309
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
310
310
|
|
|
311
311
|
| Param | Type | Description |
|
|
@@ -318,7 +318,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
318
318
|
### instanceValidator.shouldBeBoolean(configPath, [message]) ⇒ <code>this</code>
|
|
319
319
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not of type Boolean.
|
|
320
320
|
|
|
321
|
-
**Kind**: instance method of <code>
|
|
321
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
322
322
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
323
323
|
|
|
324
324
|
| Param | Type | Description |
|
|
@@ -331,7 +331,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
331
331
|
### instanceValidator.shouldNotBeBoolean(configPath, [message]) ⇒ <code>this</code>
|
|
332
332
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is of type Boolean.
|
|
333
333
|
|
|
334
|
-
**Kind**: instance method of <code>
|
|
334
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
335
335
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
336
336
|
|
|
337
337
|
| Param | Type | Description |
|
|
@@ -344,7 +344,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
344
344
|
### instanceValidator.shouldBeDate(configPath, [message]) ⇒ <code>this</code>
|
|
345
345
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not of type Date.
|
|
346
346
|
|
|
347
|
-
**Kind**: instance method of <code>
|
|
347
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
348
348
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
349
349
|
|
|
350
350
|
| Param | Type | Description |
|
|
@@ -357,7 +357,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
357
357
|
### instanceValidator.shouldNotBeDate(configPath, [message]) ⇒ <code>this</code>
|
|
358
358
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is of type Date.
|
|
359
359
|
|
|
360
|
-
**Kind**: instance method of <code>
|
|
360
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
361
361
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
362
362
|
|
|
363
363
|
| Param | Type | Description |
|
|
@@ -370,7 +370,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
370
370
|
### instanceValidator.shouldBeRegExp(configPath, [message]) ⇒ <code>this</code>
|
|
371
371
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not a Regular Expression.
|
|
372
372
|
|
|
373
|
-
**Kind**: instance method of <code>
|
|
373
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
374
374
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
375
375
|
|
|
376
376
|
| Param | Type | Description |
|
|
@@ -383,7 +383,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
383
383
|
### instanceValidator.shouldNotBeRegExp(configPath, [message]) ⇒ <code>this</code>
|
|
384
384
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is a Regular Expression.
|
|
385
385
|
|
|
386
|
-
**Kind**: instance method of <code>
|
|
386
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
387
387
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
388
388
|
|
|
389
389
|
| Param | Type | Description |
|
|
@@ -396,7 +396,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
396
396
|
### instanceValidator.shouldBeFalsey(configPath, [message]) ⇒ <code>this</code>
|
|
397
397
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is not falsey.
|
|
398
398
|
|
|
399
|
-
**Kind**: instance method of <code>
|
|
399
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
400
400
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
401
401
|
|
|
402
402
|
| Param | Type | Description |
|
|
@@ -409,7 +409,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
409
409
|
### instanceValidator.shouldNotBeFalsey(configPath, [message]) ⇒ <code>this</code>
|
|
410
410
|
Throws an error if any value does not exist in the objectToTest, from configPath. Throws an error if the last key from configPath is falsey.
|
|
411
411
|
|
|
412
|
-
**Kind**: instance method of <code>
|
|
412
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
413
413
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
414
414
|
|
|
415
415
|
| Param | Type | Description |
|
|
@@ -422,7 +422,7 @@ Throws an error if any value does not exist in the objectToTest, from configPath
|
|
|
422
422
|
### instanceValidator.shouldBeFalsy(configPath, [message]) ⇒ <code>this</code>
|
|
423
423
|
Synonym for shouldBeFalsey.
|
|
424
424
|
|
|
425
|
-
**Kind**: instance method of <code>
|
|
425
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
426
426
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
427
427
|
|
|
428
428
|
| Param | Type | Description |
|
|
@@ -435,7 +435,7 @@ Synonym for shouldBeFalsey.
|
|
|
435
435
|
### instanceValidator.shouldNotBeFalsy(configPath, [message]) ⇒ <code>this</code>
|
|
436
436
|
Synonym for shouldNotBeFalsey.
|
|
437
437
|
|
|
438
|
-
**Kind**: instance method of <code>
|
|
438
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
439
439
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
440
440
|
|
|
441
441
|
| Param | Type | Description |
|
|
@@ -448,7 +448,7 @@ Synonym for shouldNotBeFalsey.
|
|
|
448
448
|
### instanceValidator.shouldBeTruthy(configPath, [message]) ⇒ <code>this</code>
|
|
449
449
|
Synonym for shouldNotBeFalsey.
|
|
450
450
|
|
|
451
|
-
**Kind**: instance method of <code>
|
|
451
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
452
452
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
453
453
|
|
|
454
454
|
| Param | Type | Description |
|
|
@@ -461,7 +461,7 @@ Synonym for shouldNotBeFalsey.
|
|
|
461
461
|
### instanceValidator.shouldNotBeTruthy(configPath, [message]) ⇒ <code>this</code>
|
|
462
462
|
Synonym for shouldBeFalsey.
|
|
463
463
|
|
|
464
|
-
**Kind**: instance method of <code>
|
|
464
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
465
465
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
466
466
|
|
|
467
467
|
| Param | Type | Description |
|
|
@@ -474,7 +474,7 @@ Synonym for shouldBeFalsey.
|
|
|
474
474
|
### instanceValidator.checkArgument(expression, [message], [template]) ⇒ <code>this</code>
|
|
475
475
|
Ensures the truth of an expression involving one or more parameters to the calling method.
|
|
476
476
|
|
|
477
|
-
**Kind**: instance method of <code>
|
|
477
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
478
478
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
479
479
|
|
|
480
480
|
| Param | Type | Description |
|
|
@@ -488,7 +488,7 @@ Ensures the truth of an expression involving one or more parameters to the calli
|
|
|
488
488
|
### instanceValidator.checkState(expression, [message]) ⇒ <code>this</code>
|
|
489
489
|
Ensures the truth of an expression involving the state of the calling InstanceValidator, but not involving any parameters to the calling method.
|
|
490
490
|
|
|
491
|
-
**Kind**: instance method of <code>
|
|
491
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
492
492
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
493
493
|
|
|
494
494
|
| Param | Type | Description |
|
|
@@ -501,7 +501,7 @@ Ensures the truth of an expression involving the state of the calling InstanceVa
|
|
|
501
501
|
### instanceValidator.checkElementIndex(index, size, [message]) ⇒ <code>this</code>
|
|
502
502
|
Ensures that index specifies a valid element in an array, list or string of size size.
|
|
503
503
|
|
|
504
|
-
**Kind**: instance method of <code>
|
|
504
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
505
505
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
506
506
|
|
|
507
507
|
| Param | Type | Description |
|
|
@@ -515,7 +515,7 @@ Ensures that index specifies a valid element in an array, list or string of size
|
|
|
515
515
|
### instanceValidator.checkPositionIndex(index, size, [message]) ⇒ <code>this</code>
|
|
516
516
|
Ensures that index specifies a valid position in an array, list or string of size size.
|
|
517
517
|
|
|
518
|
-
**Kind**: instance method of <code>
|
|
518
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
519
519
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
520
520
|
|
|
521
521
|
| Param | Type | Description |
|
|
@@ -529,7 +529,7 @@ Ensures that index specifies a valid position in an array, list or string of siz
|
|
|
529
529
|
### instanceValidator.checkPositionIndexes(start, end, size, [message]) ⇒ <code>this</code>
|
|
530
530
|
Ensures that start and end specify a valid positions in an array, list or string of size size, and are in order.
|
|
531
531
|
|
|
532
|
-
**Kind**: instance method of <code>
|
|
532
|
+
**Kind**: instance method of [<code>InstanceValidator</code>](#InstanceValidator)
|
|
533
533
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
534
534
|
|
|
535
535
|
| Param | Type | Description |
|
|
@@ -590,7 +590,7 @@ Use this interface if you want to utilize the following functionality:
|
|
|
590
590
|
### SingletonValidator.shouldBeDefined(val, [message], [template]) ⇒ <code>this</code>
|
|
591
591
|
Throws an error if 'val' is not defined.
|
|
592
592
|
|
|
593
|
-
**Kind**: static method of <code>
|
|
593
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
594
594
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
595
595
|
|
|
596
596
|
| Param | Type | Description |
|
|
@@ -604,7 +604,7 @@ Throws an error if 'val' is not defined.
|
|
|
604
604
|
### SingletonValidator.shouldBeUndefined(val, [message], [template]) ⇒ <code>this</code>
|
|
605
605
|
Throws an error if 'val' is defined.
|
|
606
606
|
|
|
607
|
-
**Kind**: static method of <code>
|
|
607
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
608
608
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
609
609
|
|
|
610
610
|
| Param | Type | Description |
|
|
@@ -618,7 +618,7 @@ Throws an error if 'val' is defined.
|
|
|
618
618
|
### SingletonValidator.shouldBeArray(val, [message], [template]) ⇒ <code>this</code>
|
|
619
619
|
Throws an error if 'val' is not of type Array.
|
|
620
620
|
|
|
621
|
-
**Kind**: static method of <code>
|
|
621
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
622
622
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
623
623
|
|
|
624
624
|
| Param | Type | Description |
|
|
@@ -632,7 +632,7 @@ Throws an error if 'val' is not of type Array.
|
|
|
632
632
|
### SingletonValidator.shouldNotBeArray(val, [message], [template]) ⇒ <code>this</code>
|
|
633
633
|
Throws an error if 'val' is of type Array.
|
|
634
634
|
|
|
635
|
-
**Kind**: static method of <code>
|
|
635
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
636
636
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
637
637
|
|
|
638
638
|
| Param | Type | Description |
|
|
@@ -646,7 +646,7 @@ Throws an error if 'val' is of type Array.
|
|
|
646
646
|
### SingletonValidator.shouldBeObject(val, [message], [template]) ⇒ <code>this</code>
|
|
647
647
|
Throws an error if 'val' is not of type Object.
|
|
648
648
|
|
|
649
|
-
**Kind**: static method of <code>
|
|
649
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
650
650
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
651
651
|
|
|
652
652
|
| Param | Type | Description |
|
|
@@ -660,7 +660,7 @@ Throws an error if 'val' is not of type Object.
|
|
|
660
660
|
### SingletonValidator.shouldNotBeObject(val, [message], [template]) ⇒ <code>this</code>
|
|
661
661
|
Throws an error if 'val' is of type Object.
|
|
662
662
|
|
|
663
|
-
**Kind**: static method of <code>
|
|
663
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
664
664
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
665
665
|
|
|
666
666
|
| Param | Type | Description |
|
|
@@ -674,7 +674,7 @@ Throws an error if 'val' is of type Object.
|
|
|
674
674
|
### SingletonValidator.shouldBeEmpty(val, [message], [template]) ⇒ <code>this</code>
|
|
675
675
|
Throws an error if 'val' is not empty.
|
|
676
676
|
|
|
677
|
-
**Kind**: static method of <code>
|
|
677
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
678
678
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
679
679
|
|
|
680
680
|
| Param | Type | Description |
|
|
@@ -688,7 +688,7 @@ Throws an error if 'val' is not empty.
|
|
|
688
688
|
### SingletonValidator.shouldNotBeEmpty(val, [message], [template]) ⇒ <code>this</code>
|
|
689
689
|
Throws an error if 'val' is empty.
|
|
690
690
|
|
|
691
|
-
**Kind**: static method of <code>
|
|
691
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
692
692
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
693
693
|
|
|
694
694
|
| Param | Type | Description |
|
|
@@ -702,7 +702,7 @@ Throws an error if 'val' is empty.
|
|
|
702
702
|
### SingletonValidator.shouldBeFunction(val, [message], [template]) ⇒ <code>this</code>
|
|
703
703
|
Throws an error if 'val' is not of type Function.
|
|
704
704
|
|
|
705
|
-
**Kind**: static method of <code>
|
|
705
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
706
706
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
707
707
|
|
|
708
708
|
| Param | Type | Description |
|
|
@@ -716,7 +716,7 @@ Throws an error if 'val' is not of type Function.
|
|
|
716
716
|
### SingletonValidator.shouldNotBeFunction(val, [message], [template]) ⇒ <code>this</code>
|
|
717
717
|
Throws an error if 'val' is of type Function.
|
|
718
718
|
|
|
719
|
-
**Kind**: static method of <code>
|
|
719
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
720
720
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
721
721
|
|
|
722
722
|
| Param | Type | Description |
|
|
@@ -730,7 +730,7 @@ Throws an error if 'val' is of type Function.
|
|
|
730
730
|
### SingletonValidator.shouldBeString(val, [message], [template]) ⇒ <code>this</code>
|
|
731
731
|
Throws an error if 'val' is not of type String.
|
|
732
732
|
|
|
733
|
-
**Kind**: static method of <code>
|
|
733
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
734
734
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
735
735
|
|
|
736
736
|
| Param | Type | Description |
|
|
@@ -744,7 +744,7 @@ Throws an error if 'val' is not of type String.
|
|
|
744
744
|
### SingletonValidator.shouldNotBeString(val, [message], [template]) ⇒ <code>this</code>
|
|
745
745
|
Throws an error if 'val' is of type String.
|
|
746
746
|
|
|
747
|
-
**Kind**: static method of <code>
|
|
747
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
748
748
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
749
749
|
|
|
750
750
|
| Param | Type | Description |
|
|
@@ -758,7 +758,7 @@ Throws an error if 'val' is of type String.
|
|
|
758
758
|
### SingletonValidator.shouldBeNumber(val, [message], [template]) ⇒ <code>this</code>
|
|
759
759
|
Throws an error if 'val' is not of type Number.
|
|
760
760
|
|
|
761
|
-
**Kind**: static method of <code>
|
|
761
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
762
762
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
763
763
|
|
|
764
764
|
| Param | Type | Description |
|
|
@@ -772,7 +772,7 @@ Throws an error if 'val' is not of type Number.
|
|
|
772
772
|
### SingletonValidator.shouldNotBeNumber(val, [message], [template]) ⇒ <code>this</code>
|
|
773
773
|
Throws an error if 'val' is of type Number.
|
|
774
774
|
|
|
775
|
-
**Kind**: static method of <code>
|
|
775
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
776
776
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
777
777
|
|
|
778
778
|
| Param | Type | Description |
|
|
@@ -786,7 +786,7 @@ Throws an error if 'val' is of type Number.
|
|
|
786
786
|
### SingletonValidator.shouldBeFinite(val, [message], [template]) ⇒ <code>this</code>
|
|
787
787
|
Throws an error if 'val' is not finite.
|
|
788
788
|
|
|
789
|
-
**Kind**: static method of <code>
|
|
789
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
790
790
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
791
791
|
|
|
792
792
|
| Param | Type | Description |
|
|
@@ -800,7 +800,7 @@ Throws an error if 'val' is not finite.
|
|
|
800
800
|
### SingletonValidator.shouldBeInfinite(val, [message], [template]) ⇒ <code>this</code>
|
|
801
801
|
Throws an error if 'val' is not infinite.
|
|
802
802
|
|
|
803
|
-
**Kind**: static method of <code>
|
|
803
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
804
804
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
805
805
|
|
|
806
806
|
| Param | Type | Description |
|
|
@@ -814,7 +814,7 @@ Throws an error if 'val' is not infinite.
|
|
|
814
814
|
### SingletonValidator.shouldBeBoolean(val, [message], [template]) ⇒ <code>this</code>
|
|
815
815
|
Throws an error if 'val' is not of type Boolean.
|
|
816
816
|
|
|
817
|
-
**Kind**: static method of <code>
|
|
817
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
818
818
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
819
819
|
|
|
820
820
|
| Param | Type | Description |
|
|
@@ -828,7 +828,7 @@ Throws an error if 'val' is not of type Boolean.
|
|
|
828
828
|
### SingletonValidator.shouldNotBeBoolean(val, [message], [template]) ⇒ <code>this</code>
|
|
829
829
|
Throws an error if 'val' is of type Boolean.
|
|
830
830
|
|
|
831
|
-
**Kind**: static method of <code>
|
|
831
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
832
832
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
833
833
|
|
|
834
834
|
| Param | Type | Description |
|
|
@@ -842,7 +842,7 @@ Throws an error if 'val' is of type Boolean.
|
|
|
842
842
|
### SingletonValidator.shouldBeDate(val, [message], [template]) ⇒ <code>this</code>
|
|
843
843
|
Throws an error if 'val' is not of type Date.
|
|
844
844
|
|
|
845
|
-
**Kind**: static method of <code>
|
|
845
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
846
846
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
847
847
|
|
|
848
848
|
| Param | Type | Description |
|
|
@@ -856,7 +856,7 @@ Throws an error if 'val' is not of type Date.
|
|
|
856
856
|
### SingletonValidator.shouldNotBeDate(val, [message], [template]) ⇒ <code>this</code>
|
|
857
857
|
Throws an error if 'val' is of type Date.
|
|
858
858
|
|
|
859
|
-
**Kind**: static method of <code>
|
|
859
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
860
860
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
861
861
|
|
|
862
862
|
| Param | Type | Description |
|
|
@@ -870,7 +870,7 @@ Throws an error if 'val' is of type Date.
|
|
|
870
870
|
### SingletonValidator.shouldBeRegExp(val, [message], [template]) ⇒ <code>this</code>
|
|
871
871
|
Throws an error if 'val' is not a Regular Expression.
|
|
872
872
|
|
|
873
|
-
**Kind**: static method of <code>
|
|
873
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
874
874
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
875
875
|
|
|
876
876
|
| Param | Type | Description |
|
|
@@ -884,7 +884,7 @@ Throws an error if 'val' is not a Regular Expression.
|
|
|
884
884
|
### SingletonValidator.shouldNotBeRegExp(val, [message], [template]) ⇒ <code>this</code>
|
|
885
885
|
Throws an error if 'val' is a Regular Expression.
|
|
886
886
|
|
|
887
|
-
**Kind**: static method of <code>
|
|
887
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
888
888
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
889
889
|
|
|
890
890
|
| Param | Type | Description |
|
|
@@ -898,7 +898,7 @@ Throws an error if 'val' is a Regular Expression.
|
|
|
898
898
|
### SingletonValidator.shouldBeFalsey(val, [message], [template]) ⇒ <code>this</code>
|
|
899
899
|
Throws an error if 'val' is not falsey.
|
|
900
900
|
|
|
901
|
-
**Kind**: static method of <code>
|
|
901
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
902
902
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
903
903
|
|
|
904
904
|
| Param | Type | Description |
|
|
@@ -912,7 +912,7 @@ Throws an error if 'val' is not falsey.
|
|
|
912
912
|
### SingletonValidator.shouldNotBeFalsey(val, [message], [template]) ⇒ <code>this</code>
|
|
913
913
|
Throws an error if 'val' is falsey.
|
|
914
914
|
|
|
915
|
-
**Kind**: static method of <code>
|
|
915
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
916
916
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
917
917
|
|
|
918
918
|
| Param | Type | Description |
|
|
@@ -926,7 +926,7 @@ Throws an error if 'val' is falsey.
|
|
|
926
926
|
### SingletonValidator.shouldBeFalsy(val, [message], [template]) ⇒ <code>this</code>
|
|
927
927
|
Synonym for shouldBeFalsey.
|
|
928
928
|
|
|
929
|
-
**Kind**: static method of <code>
|
|
929
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
930
930
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
931
931
|
|
|
932
932
|
| Param | Type | Description |
|
|
@@ -940,7 +940,7 @@ Synonym for shouldBeFalsey.
|
|
|
940
940
|
### SingletonValidator.shouldNotBeFalsy(val, [message], [template]) ⇒ <code>this</code>
|
|
941
941
|
Synonym for shouldNotBeFalsey.
|
|
942
942
|
|
|
943
|
-
**Kind**: static method of <code>
|
|
943
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
944
944
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
945
945
|
|
|
946
946
|
| Param | Type | Description |
|
|
@@ -954,7 +954,7 @@ Synonym for shouldNotBeFalsey.
|
|
|
954
954
|
### SingletonValidator.shouldBeTruthy(val, [message], [template]) ⇒ <code>this</code>
|
|
955
955
|
Synonym for shouldNotBeFalsey.
|
|
956
956
|
|
|
957
|
-
**Kind**: static method of <code>
|
|
957
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
958
958
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
959
959
|
|
|
960
960
|
| Param | Type | Description |
|
|
@@ -968,7 +968,7 @@ Synonym for shouldNotBeFalsey.
|
|
|
968
968
|
### SingletonValidator.shouldNotBeTruthy(val, [message], [template]) ⇒ <code>this</code>
|
|
969
969
|
Synonym for shouldBeFalsey.
|
|
970
970
|
|
|
971
|
-
**Kind**: static method of <code>
|
|
971
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
972
972
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
973
973
|
|
|
974
974
|
| Param | Type | Description |
|
|
@@ -982,7 +982,7 @@ Synonym for shouldBeFalsey.
|
|
|
982
982
|
### SingletonValidator.checkArgument(expression, [message], [template]) ⇒ <code>this</code>
|
|
983
983
|
Ensures the truth of an expression involving one or more parameters to the calling method.
|
|
984
984
|
|
|
985
|
-
**Kind**: static method of <code>
|
|
985
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
986
986
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
987
987
|
|
|
988
988
|
| Param | Type | Description |
|
|
@@ -996,7 +996,7 @@ Ensures the truth of an expression involving one or more parameters to the calli
|
|
|
996
996
|
### SingletonValidator.checkState(expression, [message], [template]) ⇒ <code>this</code>
|
|
997
997
|
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
|
|
998
998
|
|
|
999
|
-
**Kind**: static method of <code>
|
|
999
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
1000
1000
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
1001
1001
|
|
|
1002
1002
|
| Param | Type | Description |
|
|
@@ -1010,7 +1010,7 @@ Ensures the truth of an expression involving the state of the calling instance,
|
|
|
1010
1010
|
### SingletonValidator.checkElementIndex(index, size, [message], [template]) ⇒ <code>this</code>
|
|
1011
1011
|
Ensures that index specifies a valid element in an array, list or string of size size.
|
|
1012
1012
|
|
|
1013
|
-
**Kind**: static method of <code>
|
|
1013
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
1014
1014
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
1015
1015
|
|
|
1016
1016
|
| Param | Type | Description |
|
|
@@ -1025,7 +1025,7 @@ Ensures that index specifies a valid element in an array, list or string of size
|
|
|
1025
1025
|
### SingletonValidator.checkPositionIndex(index, size, [message], [template]) ⇒ <code>this</code>
|
|
1026
1026
|
Ensures that index specifies a valid position in an array, list or string of size size.
|
|
1027
1027
|
|
|
1028
|
-
**Kind**: static method of <code>
|
|
1028
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
1029
1029
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
1030
1030
|
|
|
1031
1031
|
| Param | Type | Description |
|
|
@@ -1040,7 +1040,7 @@ Ensures that index specifies a valid position in an array, list or string of siz
|
|
|
1040
1040
|
### SingletonValidator.checkPositionIndexes(start, end, size, [message], [template]) ⇒ <code>this</code>
|
|
1041
1041
|
Ensures that start and end specify a valid positions in an array, list or string of size size, and are in order.
|
|
1042
1042
|
|
|
1043
|
-
**Kind**: static method of <code>
|
|
1043
|
+
**Kind**: static method of [<code>SingletonValidator</code>](#SingletonValidator)
|
|
1044
1044
|
**Returns**: <code>this</code> - - Returns itself to allow chainable validations.
|
|
1045
1045
|
|
|
1046
1046
|
| Param | Type | Description |
|
|
@@ -1060,10 +1060,10 @@ Error Builder allows you to use optional functions to build an error object. Th
|
|
|
1060
1060
|
|
|
1061
1061
|
* [ErrrDecorator](#ErrrDecorator)
|
|
1062
1062
|
* [new ErrrDecorator([message], [template])](#new_ErrrDecorator_new)
|
|
1063
|
-
* [.debug(params, [shouldDebug])](#ErrrDecorator+debug) ⇒ <code>
|
|
1064
|
-
* [.set(key, value, [force])](#ErrrDecorator+set) ⇒ <code>
|
|
1065
|
-
* [.setAll(key, value, [force])](#ErrrDecorator+setAll) ⇒ <code>
|
|
1066
|
-
* [.appendTo(err)](#ErrrDecorator+appendTo) ⇒ <code>
|
|
1063
|
+
* [.debug(params, [shouldDebug])](#ErrrDecorator+debug) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1064
|
+
* [.set(key, value, [force])](#ErrrDecorator+set) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1065
|
+
* [.setAll(key, value, [force])](#ErrrDecorator+setAll) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1066
|
+
* [.appendTo(err)](#ErrrDecorator+appendTo) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1067
1067
|
* [.test()](#ErrrDecorator+test)
|
|
1068
1068
|
* [.t()](#ErrrDecorator+t)
|
|
1069
1069
|
|
|
@@ -1080,11 +1080,11 @@ Provides an interface to build an error. Then allows you to get or throw the er
|
|
|
1080
1080
|
|
|
1081
1081
|
<a name="ErrrDecorator+debug"></a>
|
|
1082
1082
|
|
|
1083
|
-
### errrDecorator.debug(params, [shouldDebug]) ⇒ <code>
|
|
1083
|
+
### errrDecorator.debug(params, [shouldDebug]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1084
1084
|
Decorated function from 'errr' module. Add parameters to the stack trace that will make it easier to debug the problem.
|
|
1085
1085
|
|
|
1086
|
-
**Kind**: instance method of <code>
|
|
1087
|
-
**Returns**: <code>
|
|
1086
|
+
**Kind**: instance method of [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1087
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - Returns the instance of errorBuilder to allow chainability.
|
|
1088
1088
|
|
|
1089
1089
|
| Param | Type | Description |
|
|
1090
1090
|
| --- | --- | --- |
|
|
@@ -1093,11 +1093,11 @@ Decorated function from 'errr' module. Add parameters to the stack trace that wi
|
|
|
1093
1093
|
|
|
1094
1094
|
<a name="ErrrDecorator+set"></a>
|
|
1095
1095
|
|
|
1096
|
-
### errrDecorator.set(key, value, [force]) ⇒ <code>
|
|
1096
|
+
### errrDecorator.set(key, value, [force]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1097
1097
|
Decorated function from 'errr' module. Sets an immutable value on the error object using the key as the variable name.
|
|
1098
1098
|
|
|
1099
|
-
**Kind**: instance method of <code>
|
|
1100
|
-
**Returns**: <code>
|
|
1099
|
+
**Kind**: instance method of [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1100
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - Returns the instance of errorBuilder to allow chainability.
|
|
1101
1101
|
|
|
1102
1102
|
| Param | Type | Description |
|
|
1103
1103
|
| --- | --- | --- |
|
|
@@ -1107,12 +1107,12 @@ Decorated function from 'errr' module. Sets an immutable value on the error obje
|
|
|
1107
1107
|
|
|
1108
1108
|
<a name="ErrrDecorator+setAll"></a>
|
|
1109
1109
|
|
|
1110
|
-
### errrDecorator.setAll(key, value, [force]) ⇒ <code>
|
|
1110
|
+
### errrDecorator.setAll(key, value, [force]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1111
1111
|
Decorated function from 'errr' module. Same concept and functionality as the 'set' function. The difference is
|
|
1112
1112
|
that you can set all values in a given object onto the Errr instance.
|
|
1113
1113
|
|
|
1114
|
-
**Kind**: instance method of <code>
|
|
1115
|
-
**Returns**: <code>
|
|
1114
|
+
**Kind**: instance method of [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1115
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - Returns the instance of errorBuilder to allow chainability.
|
|
1116
1116
|
|
|
1117
1117
|
| Param | Type | Description |
|
|
1118
1118
|
| --- | --- | --- |
|
|
@@ -1122,11 +1122,11 @@ that you can set all values in a given object onto the Errr instance.
|
|
|
1122
1122
|
|
|
1123
1123
|
<a name="ErrrDecorator+appendTo"></a>
|
|
1124
1124
|
|
|
1125
|
-
### errrDecorator.appendTo(err) ⇒ <code>
|
|
1125
|
+
### errrDecorator.appendTo(err) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1126
1126
|
Decorated function from 'errr' module. Append the error being built, to the end of this error's stack trace.
|
|
1127
1127
|
|
|
1128
|
-
**Kind**: instance method of <code>
|
|
1129
|
-
**Returns**: <code>
|
|
1128
|
+
**Kind**: instance method of [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1129
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - Returns the instance of errorBuilder to allow chainability.
|
|
1130
1130
|
|
|
1131
1131
|
| Param | Type | Description |
|
|
1132
1132
|
| --- | --- | --- |
|
|
@@ -1137,13 +1137,13 @@ Decorated function from 'errr' module. Append the error being built, to the end
|
|
|
1137
1137
|
### errrDecorator.test()
|
|
1138
1138
|
Validate preconditions check and throw an errr if it fails.
|
|
1139
1139
|
|
|
1140
|
-
**Kind**: instance method of <code>
|
|
1140
|
+
**Kind**: instance method of [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1141
1141
|
<a name="ErrrDecorator+t"></a>
|
|
1142
1142
|
|
|
1143
1143
|
### errrDecorator.t()
|
|
1144
1144
|
Synonym for the test function.
|
|
1145
1145
|
|
|
1146
|
-
**Kind**: instance method of <code>
|
|
1146
|
+
**Kind**: instance method of [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1147
1147
|
<a name="ErrrValidator"></a>
|
|
1148
1148
|
|
|
1149
1149
|
## ErrrValidator
|
|
@@ -1157,61 +1157,61 @@ Use this interface if you want to utilize the following functionality:
|
|
|
1157
1157
|
**Kind**: global class
|
|
1158
1158
|
|
|
1159
1159
|
* [ErrrValidator](#ErrrValidator)
|
|
1160
|
-
* [.shouldBeDefined(val, [message], [template])](#ErrrValidator.shouldBeDefined) ⇒ <code>
|
|
1161
|
-
* [.shouldBeUndefined(val, [message], [template])](#ErrrValidator.shouldBeUndefined) ⇒ <code>
|
|
1162
|
-
* [.shouldBeArray(val, [message], [template])](#ErrrValidator.shouldBeArray) ⇒ <code>
|
|
1163
|
-
* [.shouldNotBeArray(val, [message], [template])](#ErrrValidator.shouldNotBeArray) ⇒ <code>
|
|
1164
|
-
* [.shouldBeObject(val, [message], [template])](#ErrrValidator.shouldBeObject) ⇒ <code>
|
|
1165
|
-
* [.shouldNotBeObject(val, [message], [template])](#ErrrValidator.shouldNotBeObject) ⇒ <code>
|
|
1166
|
-
* [.shouldBeEmpty(val, [message], [template])](#ErrrValidator.shouldBeEmpty) ⇒ <code>
|
|
1167
|
-
* [.shouldNotBeEmpty(val, [message], [template])](#ErrrValidator.shouldNotBeEmpty) ⇒ <code>
|
|
1168
|
-
* [.shouldBeFunction(val, [message], [template])](#ErrrValidator.shouldBeFunction) ⇒ <code>
|
|
1169
|
-
* [.shouldNotBeFunction(val, [message], [template])](#ErrrValidator.shouldNotBeFunction) ⇒ <code>
|
|
1170
|
-
* [.shouldBeString(val, [message], [template])](#ErrrValidator.shouldBeString) ⇒ <code>
|
|
1171
|
-
* [.shouldNotBeString(val, [message], [template])](#ErrrValidator.shouldNotBeString) ⇒ <code>
|
|
1172
|
-
* [.shouldBeNumber(val, [message], [template])](#ErrrValidator.shouldBeNumber) ⇒ <code>
|
|
1173
|
-
* [.shouldNotBeNumber(val, [message], [template])](#ErrrValidator.shouldNotBeNumber) ⇒ <code>
|
|
1174
|
-
* [.shouldBeFinite(val, [message], [template])](#ErrrValidator.shouldBeFinite) ⇒ <code>
|
|
1175
|
-
* [.shouldBeInfinite(val, [message], [template])](#ErrrValidator.shouldBeInfinite) ⇒ <code>
|
|
1176
|
-
* [.shouldBeBoolean(val, [message], [template])](#ErrrValidator.shouldBeBoolean) ⇒ <code>
|
|
1177
|
-
* [.shouldNotBeBoolean(val, [message], [template])](#ErrrValidator.shouldNotBeBoolean) ⇒ <code>
|
|
1178
|
-
* [.shouldBeDate(val, [message], [template])](#ErrrValidator.shouldBeDate) ⇒ <code>
|
|
1179
|
-
* [.shouldNotBeDate(val, [message], [template])](#ErrrValidator.shouldNotBeDate) ⇒ <code>
|
|
1180
|
-
* [.shouldBeRegExp(val, [message], [template])](#ErrrValidator.shouldBeRegExp) ⇒ <code>
|
|
1181
|
-
* [.shouldNotBeRegExp(val, [message], [template])](#ErrrValidator.shouldNotBeRegExp) ⇒ <code>
|
|
1182
|
-
* [.shouldBeFalsey(val, [message], [template])](#ErrrValidator.shouldBeFalsey) ⇒ <code>
|
|
1183
|
-
* [.shouldNotBeFalsey(val, [message], [template])](#ErrrValidator.shouldNotBeFalsey) ⇒ <code>
|
|
1184
|
-
* [.shouldBeFalsy(val, [message], [template])](#ErrrValidator.shouldBeFalsy) ⇒ <code>
|
|
1185
|
-
* [.shouldNotBeFalsy(val, [message], [template])](#ErrrValidator.shouldNotBeFalsy) ⇒ <code>
|
|
1186
|
-
* [.shouldBeTruthy(val, [message], [template])](#ErrrValidator.shouldBeTruthy) ⇒ <code>
|
|
1187
|
-
* [.shouldNotBeTruthy(val, [message], [template])](#ErrrValidator.shouldNotBeTruthy) ⇒ <code>
|
|
1188
|
-
* [.checkArgument(expression, [message], [template])](#ErrrValidator.checkArgument) ⇒ <code>
|
|
1189
|
-
* [.checkState(expression, [message], [template])](#ErrrValidator.checkState) ⇒ <code>
|
|
1190
|
-
* [.checkElementIndex(index, size, [message], [template])](#ErrrValidator.checkElementIndex) ⇒ <code>
|
|
1191
|
-
* [.checkPositionIndex(index, size, [message], [template])](#ErrrValidator.checkPositionIndex) ⇒ <code>
|
|
1192
|
-
* [.checkPositionIndexes(start, end, size, [message], [template])](#ErrrValidator.checkPositionIndexes) ⇒ <code>
|
|
1160
|
+
* [.shouldBeDefined(val, [message], [template])](#ErrrValidator.shouldBeDefined) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1161
|
+
* [.shouldBeUndefined(val, [message], [template])](#ErrrValidator.shouldBeUndefined) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1162
|
+
* [.shouldBeArray(val, [message], [template])](#ErrrValidator.shouldBeArray) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1163
|
+
* [.shouldNotBeArray(val, [message], [template])](#ErrrValidator.shouldNotBeArray) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1164
|
+
* [.shouldBeObject(val, [message], [template])](#ErrrValidator.shouldBeObject) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1165
|
+
* [.shouldNotBeObject(val, [message], [template])](#ErrrValidator.shouldNotBeObject) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1166
|
+
* [.shouldBeEmpty(val, [message], [template])](#ErrrValidator.shouldBeEmpty) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1167
|
+
* [.shouldNotBeEmpty(val, [message], [template])](#ErrrValidator.shouldNotBeEmpty) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1168
|
+
* [.shouldBeFunction(val, [message], [template])](#ErrrValidator.shouldBeFunction) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1169
|
+
* [.shouldNotBeFunction(val, [message], [template])](#ErrrValidator.shouldNotBeFunction) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1170
|
+
* [.shouldBeString(val, [message], [template])](#ErrrValidator.shouldBeString) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1171
|
+
* [.shouldNotBeString(val, [message], [template])](#ErrrValidator.shouldNotBeString) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1172
|
+
* [.shouldBeNumber(val, [message], [template])](#ErrrValidator.shouldBeNumber) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1173
|
+
* [.shouldNotBeNumber(val, [message], [template])](#ErrrValidator.shouldNotBeNumber) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1174
|
+
* [.shouldBeFinite(val, [message], [template])](#ErrrValidator.shouldBeFinite) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1175
|
+
* [.shouldBeInfinite(val, [message], [template])](#ErrrValidator.shouldBeInfinite) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1176
|
+
* [.shouldBeBoolean(val, [message], [template])](#ErrrValidator.shouldBeBoolean) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1177
|
+
* [.shouldNotBeBoolean(val, [message], [template])](#ErrrValidator.shouldNotBeBoolean) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1178
|
+
* [.shouldBeDate(val, [message], [template])](#ErrrValidator.shouldBeDate) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1179
|
+
* [.shouldNotBeDate(val, [message], [template])](#ErrrValidator.shouldNotBeDate) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1180
|
+
* [.shouldBeRegExp(val, [message], [template])](#ErrrValidator.shouldBeRegExp) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1181
|
+
* [.shouldNotBeRegExp(val, [message], [template])](#ErrrValidator.shouldNotBeRegExp) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1182
|
+
* [.shouldBeFalsey(val, [message], [template])](#ErrrValidator.shouldBeFalsey) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1183
|
+
* [.shouldNotBeFalsey(val, [message], [template])](#ErrrValidator.shouldNotBeFalsey) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1184
|
+
* [.shouldBeFalsy(val, [message], [template])](#ErrrValidator.shouldBeFalsy) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1185
|
+
* [.shouldNotBeFalsy(val, [message], [template])](#ErrrValidator.shouldNotBeFalsy) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1186
|
+
* [.shouldBeTruthy(val, [message], [template])](#ErrrValidator.shouldBeTruthy) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1187
|
+
* [.shouldNotBeTruthy(val, [message], [template])](#ErrrValidator.shouldNotBeTruthy) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1188
|
+
* [.checkArgument(expression, [message], [template])](#ErrrValidator.checkArgument) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1189
|
+
* [.checkState(expression, [message], [template])](#ErrrValidator.checkState) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1190
|
+
* [.checkElementIndex(index, size, [message], [template])](#ErrrValidator.checkElementIndex) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1191
|
+
* [.checkPositionIndex(index, size, [message], [template])](#ErrrValidator.checkPositionIndex) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1192
|
+
* [.checkPositionIndexes(start, end, size, [message], [template])](#ErrrValidator.checkPositionIndexes) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1193
1193
|
|
|
1194
1194
|
<a name="ErrrValidator.shouldBeDefined"></a>
|
|
1195
1195
|
|
|
1196
|
-
### ErrrValidator.shouldBeDefined(val, [message], [template]) ⇒ <code>
|
|
1196
|
+
### ErrrValidator.shouldBeDefined(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1197
1197
|
Throws an error if 'val' is not defined.
|
|
1198
1198
|
|
|
1199
|
-
**Kind**: static method of <code>
|
|
1200
|
-
**Returns**: <code>
|
|
1199
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1200
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1201
1201
|
|
|
1202
1202
|
| Param | Type | Description |
|
|
1203
1203
|
| --- | --- | --- |
|
|
1204
|
-
| val | <code
|
|
1204
|
+
| val | <code>\*</code> | The value to validate. |
|
|
1205
1205
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1206
1206
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1207
1207
|
|
|
1208
1208
|
<a name="ErrrValidator.shouldBeUndefined"></a>
|
|
1209
1209
|
|
|
1210
|
-
### ErrrValidator.shouldBeUndefined(val, [message], [template]) ⇒ <code>
|
|
1210
|
+
### ErrrValidator.shouldBeUndefined(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1211
1211
|
Throws an error if 'val' is defined.
|
|
1212
1212
|
|
|
1213
|
-
**Kind**: static method of <code>
|
|
1214
|
-
**Returns**: <code>
|
|
1213
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1214
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1215
1215
|
|
|
1216
1216
|
| Param | Type | Description |
|
|
1217
1217
|
| --- | --- | --- |
|
|
@@ -1221,11 +1221,11 @@ Throws an error if 'val' is defined.
|
|
|
1221
1221
|
|
|
1222
1222
|
<a name="ErrrValidator.shouldBeArray"></a>
|
|
1223
1223
|
|
|
1224
|
-
### ErrrValidator.shouldBeArray(val, [message], [template]) ⇒ <code>
|
|
1224
|
+
### ErrrValidator.shouldBeArray(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1225
1225
|
Throws an error if 'val' is not of type Array.
|
|
1226
1226
|
|
|
1227
|
-
**Kind**: static method of <code>
|
|
1228
|
-
**Returns**: <code>
|
|
1227
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1228
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1229
1229
|
|
|
1230
1230
|
| Param | Type | Description |
|
|
1231
1231
|
| --- | --- | --- |
|
|
@@ -1235,11 +1235,11 @@ Throws an error if 'val' is not of type Array.
|
|
|
1235
1235
|
|
|
1236
1236
|
<a name="ErrrValidator.shouldNotBeArray"></a>
|
|
1237
1237
|
|
|
1238
|
-
### ErrrValidator.shouldNotBeArray(val, [message], [template]) ⇒ <code>
|
|
1238
|
+
### ErrrValidator.shouldNotBeArray(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1239
1239
|
Throws an error if 'val' is of type Array.
|
|
1240
1240
|
|
|
1241
|
-
**Kind**: static method of <code>
|
|
1242
|
-
**Returns**: <code>
|
|
1241
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1242
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1243
1243
|
|
|
1244
1244
|
| Param | Type | Description |
|
|
1245
1245
|
| --- | --- | --- |
|
|
@@ -1249,11 +1249,11 @@ Throws an error if 'val' is of type Array.
|
|
|
1249
1249
|
|
|
1250
1250
|
<a name="ErrrValidator.shouldBeObject"></a>
|
|
1251
1251
|
|
|
1252
|
-
### ErrrValidator.shouldBeObject(val, [message], [template]) ⇒ <code>
|
|
1252
|
+
### ErrrValidator.shouldBeObject(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1253
1253
|
Throws an error if 'val' is not of type Object.
|
|
1254
1254
|
|
|
1255
|
-
**Kind**: static method of <code>
|
|
1256
|
-
**Returns**: <code>
|
|
1255
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1256
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1257
1257
|
|
|
1258
1258
|
| Param | Type | Description |
|
|
1259
1259
|
| --- | --- | --- |
|
|
@@ -1263,11 +1263,11 @@ Throws an error if 'val' is not of type Object.
|
|
|
1263
1263
|
|
|
1264
1264
|
<a name="ErrrValidator.shouldNotBeObject"></a>
|
|
1265
1265
|
|
|
1266
|
-
### ErrrValidator.shouldNotBeObject(val, [message], [template]) ⇒ <code>
|
|
1266
|
+
### ErrrValidator.shouldNotBeObject(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1267
1267
|
Throws an error if 'val' is of type Object.
|
|
1268
1268
|
|
|
1269
|
-
**Kind**: static method of <code>
|
|
1270
|
-
**Returns**: <code>
|
|
1269
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1270
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1271
1271
|
|
|
1272
1272
|
| Param | Type | Description |
|
|
1273
1273
|
| --- | --- | --- |
|
|
@@ -1277,11 +1277,11 @@ Throws an error if 'val' is of type Object.
|
|
|
1277
1277
|
|
|
1278
1278
|
<a name="ErrrValidator.shouldBeEmpty"></a>
|
|
1279
1279
|
|
|
1280
|
-
### ErrrValidator.shouldBeEmpty(val, [message], [template]) ⇒ <code>
|
|
1280
|
+
### ErrrValidator.shouldBeEmpty(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1281
1281
|
Throws an error if 'val' is not empty.
|
|
1282
1282
|
|
|
1283
|
-
**Kind**: static method of <code>
|
|
1284
|
-
**Returns**: <code>
|
|
1283
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1284
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1285
1285
|
|
|
1286
1286
|
| Param | Type | Description |
|
|
1287
1287
|
| --- | --- | --- |
|
|
@@ -1291,11 +1291,11 @@ Throws an error if 'val' is not empty.
|
|
|
1291
1291
|
|
|
1292
1292
|
<a name="ErrrValidator.shouldNotBeEmpty"></a>
|
|
1293
1293
|
|
|
1294
|
-
### ErrrValidator.shouldNotBeEmpty(val, [message], [template]) ⇒ <code>
|
|
1294
|
+
### ErrrValidator.shouldNotBeEmpty(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1295
1295
|
Throws an error if 'val' is empty.
|
|
1296
1296
|
|
|
1297
|
-
**Kind**: static method of <code>
|
|
1298
|
-
**Returns**: <code>
|
|
1297
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1298
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1299
1299
|
|
|
1300
1300
|
| Param | Type | Description |
|
|
1301
1301
|
| --- | --- | --- |
|
|
@@ -1305,11 +1305,11 @@ Throws an error if 'val' is empty.
|
|
|
1305
1305
|
|
|
1306
1306
|
<a name="ErrrValidator.shouldBeFunction"></a>
|
|
1307
1307
|
|
|
1308
|
-
### ErrrValidator.shouldBeFunction(val, [message], [template]) ⇒ <code>
|
|
1308
|
+
### ErrrValidator.shouldBeFunction(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1309
1309
|
Throws an error if 'val' is not of type Function.
|
|
1310
1310
|
|
|
1311
|
-
**Kind**: static method of <code>
|
|
1312
|
-
**Returns**: <code>
|
|
1311
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1312
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1313
1313
|
|
|
1314
1314
|
| Param | Type | Description |
|
|
1315
1315
|
| --- | --- | --- |
|
|
@@ -1319,11 +1319,11 @@ Throws an error if 'val' is not of type Function.
|
|
|
1319
1319
|
|
|
1320
1320
|
<a name="ErrrValidator.shouldNotBeFunction"></a>
|
|
1321
1321
|
|
|
1322
|
-
### ErrrValidator.shouldNotBeFunction(val, [message], [template]) ⇒ <code>
|
|
1322
|
+
### ErrrValidator.shouldNotBeFunction(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1323
1323
|
Throws an error if 'val' is of type Function.
|
|
1324
1324
|
|
|
1325
|
-
**Kind**: static method of <code>
|
|
1326
|
-
**Returns**: <code>
|
|
1325
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1326
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1327
1327
|
|
|
1328
1328
|
| Param | Type | Description |
|
|
1329
1329
|
| --- | --- | --- |
|
|
@@ -1333,11 +1333,11 @@ Throws an error if 'val' is of type Function.
|
|
|
1333
1333
|
|
|
1334
1334
|
<a name="ErrrValidator.shouldBeString"></a>
|
|
1335
1335
|
|
|
1336
|
-
### ErrrValidator.shouldBeString(val, [message], [template]) ⇒ <code>
|
|
1336
|
+
### ErrrValidator.shouldBeString(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1337
1337
|
Throws an error if 'val' is not of type String.
|
|
1338
1338
|
|
|
1339
|
-
**Kind**: static method of <code>
|
|
1340
|
-
**Returns**: <code>
|
|
1339
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1340
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1341
1341
|
|
|
1342
1342
|
| Param | Type | Description |
|
|
1343
1343
|
| --- | --- | --- |
|
|
@@ -1347,11 +1347,11 @@ Throws an error if 'val' is not of type String.
|
|
|
1347
1347
|
|
|
1348
1348
|
<a name="ErrrValidator.shouldNotBeString"></a>
|
|
1349
1349
|
|
|
1350
|
-
### ErrrValidator.shouldNotBeString(val, [message], [template]) ⇒ <code>
|
|
1350
|
+
### ErrrValidator.shouldNotBeString(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1351
1351
|
Throws an error if 'val' is of type String.
|
|
1352
1352
|
|
|
1353
|
-
**Kind**: static method of <code>
|
|
1354
|
-
**Returns**: <code>
|
|
1353
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1354
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1355
1355
|
|
|
1356
1356
|
| Param | Type | Description |
|
|
1357
1357
|
| --- | --- | --- |
|
|
@@ -1361,11 +1361,11 @@ Throws an error if 'val' is of type String.
|
|
|
1361
1361
|
|
|
1362
1362
|
<a name="ErrrValidator.shouldBeNumber"></a>
|
|
1363
1363
|
|
|
1364
|
-
### ErrrValidator.shouldBeNumber(val, [message], [template]) ⇒ <code>
|
|
1364
|
+
### ErrrValidator.shouldBeNumber(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1365
1365
|
Throws an error if 'val' is not of type Number.
|
|
1366
1366
|
|
|
1367
|
-
**Kind**: static method of <code>
|
|
1368
|
-
**Returns**: <code>
|
|
1367
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1368
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1369
1369
|
|
|
1370
1370
|
| Param | Type | Description |
|
|
1371
1371
|
| --- | --- | --- |
|
|
@@ -1375,11 +1375,11 @@ Throws an error if 'val' is not of type Number.
|
|
|
1375
1375
|
|
|
1376
1376
|
<a name="ErrrValidator.shouldNotBeNumber"></a>
|
|
1377
1377
|
|
|
1378
|
-
### ErrrValidator.shouldNotBeNumber(val, [message], [template]) ⇒ <code>
|
|
1378
|
+
### ErrrValidator.shouldNotBeNumber(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1379
1379
|
Throws an error if 'val' is of type Number.
|
|
1380
1380
|
|
|
1381
|
-
**Kind**: static method of <code>
|
|
1382
|
-
**Returns**: <code>
|
|
1381
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1382
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1383
1383
|
|
|
1384
1384
|
| Param | Type | Description |
|
|
1385
1385
|
| --- | --- | --- |
|
|
@@ -1389,11 +1389,11 @@ Throws an error if 'val' is of type Number.
|
|
|
1389
1389
|
|
|
1390
1390
|
<a name="ErrrValidator.shouldBeFinite"></a>
|
|
1391
1391
|
|
|
1392
|
-
### ErrrValidator.shouldBeFinite(val, [message], [template]) ⇒ <code>
|
|
1392
|
+
### ErrrValidator.shouldBeFinite(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1393
1393
|
Throws an error if 'val' is not finite.
|
|
1394
1394
|
|
|
1395
|
-
**Kind**: static method of <code>
|
|
1396
|
-
**Returns**: <code>
|
|
1395
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1396
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1397
1397
|
|
|
1398
1398
|
| Param | Type | Description |
|
|
1399
1399
|
| --- | --- | --- |
|
|
@@ -1403,11 +1403,11 @@ Throws an error if 'val' is not finite.
|
|
|
1403
1403
|
|
|
1404
1404
|
<a name="ErrrValidator.shouldBeInfinite"></a>
|
|
1405
1405
|
|
|
1406
|
-
### ErrrValidator.shouldBeInfinite(val, [message], [template]) ⇒ <code>
|
|
1406
|
+
### ErrrValidator.shouldBeInfinite(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1407
1407
|
Throws an error if 'val' is finite.
|
|
1408
1408
|
|
|
1409
|
-
**Kind**: static method of <code>
|
|
1410
|
-
**Returns**: <code>
|
|
1409
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1410
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1411
1411
|
|
|
1412
1412
|
| Param | Type | Description |
|
|
1413
1413
|
| --- | --- | --- |
|
|
@@ -1417,11 +1417,11 @@ Throws an error if 'val' is finite.
|
|
|
1417
1417
|
|
|
1418
1418
|
<a name="ErrrValidator.shouldBeBoolean"></a>
|
|
1419
1419
|
|
|
1420
|
-
### ErrrValidator.shouldBeBoolean(val, [message], [template]) ⇒ <code>
|
|
1420
|
+
### ErrrValidator.shouldBeBoolean(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1421
1421
|
Throws an error if 'val' is not of type Boolean.
|
|
1422
1422
|
|
|
1423
|
-
**Kind**: static method of <code>
|
|
1424
|
-
**Returns**: <code>
|
|
1423
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1424
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1425
1425
|
|
|
1426
1426
|
| Param | Type | Description |
|
|
1427
1427
|
| --- | --- | --- |
|
|
@@ -1431,11 +1431,11 @@ Throws an error if 'val' is not of type Boolean.
|
|
|
1431
1431
|
|
|
1432
1432
|
<a name="ErrrValidator.shouldNotBeBoolean"></a>
|
|
1433
1433
|
|
|
1434
|
-
### ErrrValidator.shouldNotBeBoolean(val, [message], [template]) ⇒ <code>
|
|
1434
|
+
### ErrrValidator.shouldNotBeBoolean(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1435
1435
|
Throws an error if 'val' is of type Boolean.
|
|
1436
1436
|
|
|
1437
|
-
**Kind**: static method of <code>
|
|
1438
|
-
**Returns**: <code>
|
|
1437
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1438
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1439
1439
|
|
|
1440
1440
|
| Param | Type | Description |
|
|
1441
1441
|
| --- | --- | --- |
|
|
@@ -1445,11 +1445,11 @@ Throws an error if 'val' is of type Boolean.
|
|
|
1445
1445
|
|
|
1446
1446
|
<a name="ErrrValidator.shouldBeDate"></a>
|
|
1447
1447
|
|
|
1448
|
-
### ErrrValidator.shouldBeDate(val, [message], [template]) ⇒ <code>
|
|
1448
|
+
### ErrrValidator.shouldBeDate(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1449
1449
|
Throws an error if 'val' is not of type Date.
|
|
1450
1450
|
|
|
1451
|
-
**Kind**: static method of <code>
|
|
1452
|
-
**Returns**: <code>
|
|
1451
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1452
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1453
1453
|
|
|
1454
1454
|
| Param | Type | Description |
|
|
1455
1455
|
| --- | --- | --- |
|
|
@@ -1459,11 +1459,11 @@ Throws an error if 'val' is not of type Date.
|
|
|
1459
1459
|
|
|
1460
1460
|
<a name="ErrrValidator.shouldNotBeDate"></a>
|
|
1461
1461
|
|
|
1462
|
-
### ErrrValidator.shouldNotBeDate(val, [message], [template]) ⇒ <code>
|
|
1462
|
+
### ErrrValidator.shouldNotBeDate(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1463
1463
|
Throws an error if 'val' is of type Date.
|
|
1464
1464
|
|
|
1465
|
-
**Kind**: static method of <code>
|
|
1466
|
-
**Returns**: <code>
|
|
1465
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1466
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1467
1467
|
|
|
1468
1468
|
| Param | Type | Description |
|
|
1469
1469
|
| --- | --- | --- |
|
|
@@ -1473,11 +1473,11 @@ Throws an error if 'val' is of type Date.
|
|
|
1473
1473
|
|
|
1474
1474
|
<a name="ErrrValidator.shouldBeRegExp"></a>
|
|
1475
1475
|
|
|
1476
|
-
### ErrrValidator.shouldBeRegExp(val, [message], [template]) ⇒ <code>
|
|
1476
|
+
### ErrrValidator.shouldBeRegExp(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1477
1477
|
Throws an error if 'val' is not a Regular Expression.
|
|
1478
1478
|
|
|
1479
|
-
**Kind**: static method of <code>
|
|
1480
|
-
**Returns**: <code>
|
|
1479
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1480
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1481
1481
|
|
|
1482
1482
|
| Param | Type | Description |
|
|
1483
1483
|
| --- | --- | --- |
|
|
@@ -1487,11 +1487,11 @@ Throws an error if 'val' is not a Regular Expression.
|
|
|
1487
1487
|
|
|
1488
1488
|
<a name="ErrrValidator.shouldNotBeRegExp"></a>
|
|
1489
1489
|
|
|
1490
|
-
### ErrrValidator.shouldNotBeRegExp(val, [message], [template]) ⇒ <code>
|
|
1490
|
+
### ErrrValidator.shouldNotBeRegExp(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1491
1491
|
Throws an error if 'val' is a Regular Expression.
|
|
1492
1492
|
|
|
1493
|
-
**Kind**: static method of <code>
|
|
1494
|
-
**Returns**: <code>
|
|
1493
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1494
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1495
1495
|
|
|
1496
1496
|
| Param | Type | Description |
|
|
1497
1497
|
| --- | --- | --- |
|
|
@@ -1501,123 +1501,123 @@ Throws an error if 'val' is a Regular Expression.
|
|
|
1501
1501
|
|
|
1502
1502
|
<a name="ErrrValidator.shouldBeFalsey"></a>
|
|
1503
1503
|
|
|
1504
|
-
### ErrrValidator.shouldBeFalsey(val, [message], [template]) ⇒ <code>
|
|
1504
|
+
### ErrrValidator.shouldBeFalsey(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1505
1505
|
Throws an error if 'val' is not falsey.
|
|
1506
1506
|
|
|
1507
|
-
**Kind**: static method of <code>
|
|
1508
|
-
**Returns**: <code>
|
|
1507
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1508
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1509
1509
|
|
|
1510
1510
|
| Param | Type | Description |
|
|
1511
1511
|
| --- | --- | --- |
|
|
1512
|
-
| val | <code>
|
|
1512
|
+
| val | <code>Any</code> | The value to validate. |
|
|
1513
1513
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1514
1514
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1515
1515
|
|
|
1516
1516
|
<a name="ErrrValidator.shouldNotBeFalsey"></a>
|
|
1517
1517
|
|
|
1518
|
-
### ErrrValidator.shouldNotBeFalsey(val, [message], [template]) ⇒ <code>
|
|
1518
|
+
### ErrrValidator.shouldNotBeFalsey(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1519
1519
|
Throws an error if 'val' is falsey.
|
|
1520
1520
|
|
|
1521
|
-
**Kind**: static method of <code>
|
|
1522
|
-
**Returns**: <code>
|
|
1521
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1522
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1523
1523
|
|
|
1524
1524
|
| Param | Type | Description |
|
|
1525
1525
|
| --- | --- | --- |
|
|
1526
|
-
| val | <code>
|
|
1526
|
+
| val | <code>Any</code> | The value to validate. |
|
|
1527
1527
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1528
1528
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1529
1529
|
|
|
1530
1530
|
<a name="ErrrValidator.shouldBeFalsy"></a>
|
|
1531
1531
|
|
|
1532
|
-
### ErrrValidator.shouldBeFalsy(val, [message], [template]) ⇒ <code>
|
|
1532
|
+
### ErrrValidator.shouldBeFalsy(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1533
1533
|
Synonym for shouldBeFalsey.
|
|
1534
1534
|
|
|
1535
|
-
**Kind**: static method of <code>
|
|
1536
|
-
**Returns**: <code>
|
|
1535
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1536
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1537
1537
|
|
|
1538
1538
|
| Param | Type | Description |
|
|
1539
1539
|
| --- | --- | --- |
|
|
1540
|
-
| val | <code>
|
|
1540
|
+
| val | <code>Any</code> | The value to validate. |
|
|
1541
1541
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1542
1542
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1543
1543
|
|
|
1544
1544
|
<a name="ErrrValidator.shouldNotBeFalsy"></a>
|
|
1545
1545
|
|
|
1546
|
-
### ErrrValidator.shouldNotBeFalsy(val, [message], [template]) ⇒ <code>
|
|
1546
|
+
### ErrrValidator.shouldNotBeFalsy(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1547
1547
|
Synonym for shouldNotBeFalsey.
|
|
1548
1548
|
|
|
1549
|
-
**Kind**: static method of <code>
|
|
1550
|
-
**Returns**: <code>
|
|
1549
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1550
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1551
1551
|
|
|
1552
1552
|
| Param | Type | Description |
|
|
1553
1553
|
| --- | --- | --- |
|
|
1554
|
-
| val | <code>
|
|
1554
|
+
| val | <code>Any</code> | The value to validate. |
|
|
1555
1555
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1556
1556
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1557
1557
|
|
|
1558
1558
|
<a name="ErrrValidator.shouldBeTruthy"></a>
|
|
1559
1559
|
|
|
1560
|
-
### ErrrValidator.shouldBeTruthy(val, [message], [template]) ⇒ <code>
|
|
1560
|
+
### ErrrValidator.shouldBeTruthy(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1561
1561
|
Synonym for shouldNotBeFalsey.
|
|
1562
1562
|
|
|
1563
|
-
**Kind**: static method of <code>
|
|
1564
|
-
**Returns**: <code>
|
|
1563
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1564
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1565
1565
|
|
|
1566
1566
|
| Param | Type | Description |
|
|
1567
1567
|
| --- | --- | --- |
|
|
1568
|
-
| val | <code>
|
|
1568
|
+
| val | <code>Any</code> | The value to validate. |
|
|
1569
1569
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1570
1570
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1571
1571
|
|
|
1572
1572
|
<a name="ErrrValidator.shouldNotBeTruthy"></a>
|
|
1573
1573
|
|
|
1574
|
-
### ErrrValidator.shouldNotBeTruthy(val, [message], [template]) ⇒ <code>
|
|
1574
|
+
### ErrrValidator.shouldNotBeTruthy(val, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1575
1575
|
Synonym for shouldBeFalsey.
|
|
1576
1576
|
|
|
1577
|
-
**Kind**: static method of <code>
|
|
1578
|
-
**Returns**: <code>
|
|
1577
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1578
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1579
1579
|
|
|
1580
1580
|
| Param | Type | Description |
|
|
1581
1581
|
| --- | --- | --- |
|
|
1582
|
-
| val | <code>
|
|
1582
|
+
| val | <code>Any</code> | The value to validate. |
|
|
1583
1583
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1584
1584
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1585
1585
|
|
|
1586
1586
|
<a name="ErrrValidator.checkArgument"></a>
|
|
1587
1587
|
|
|
1588
|
-
### ErrrValidator.checkArgument(expression, [message], [template]) ⇒ <code>
|
|
1588
|
+
### ErrrValidator.checkArgument(expression, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1589
1589
|
Ensures the truth of an expression involving one or more parameters to the calling method.
|
|
1590
1590
|
|
|
1591
|
-
**Kind**: static method of <code>
|
|
1592
|
-
**Returns**: <code>
|
|
1591
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1592
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1593
1593
|
|
|
1594
1594
|
| Param | Type | Description |
|
|
1595
1595
|
| --- | --- | --- |
|
|
1596
|
-
| expression | <code>
|
|
1596
|
+
| expression | <code>Any</code> | The value to validate. |
|
|
1597
1597
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1598
1598
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1599
1599
|
|
|
1600
1600
|
<a name="ErrrValidator.checkState"></a>
|
|
1601
1601
|
|
|
1602
|
-
### ErrrValidator.checkState(expression, [message], [template]) ⇒ <code>
|
|
1602
|
+
### ErrrValidator.checkState(expression, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1603
1603
|
Ensures the truth of an expression involving the state of the calling instance, but not involving any parameters to the calling method.
|
|
1604
1604
|
|
|
1605
|
-
**Kind**: static method of <code>
|
|
1606
|
-
**Returns**: <code>
|
|
1605
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1606
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1607
1607
|
|
|
1608
1608
|
| Param | Type | Description |
|
|
1609
1609
|
| --- | --- | --- |
|
|
1610
|
-
| expression | <code>
|
|
1610
|
+
| expression | <code>Any</code> | The value to validate. |
|
|
1611
1611
|
| [message] | <code>String</code> | The error message or the error template string to use if the ErrrValidator fails. |
|
|
1612
1612
|
| [template] | <code>Array</code> | Template params. If provided, the error message will be generated using util.format(message, template). |
|
|
1613
1613
|
|
|
1614
1614
|
<a name="ErrrValidator.checkElementIndex"></a>
|
|
1615
1615
|
|
|
1616
|
-
### ErrrValidator.checkElementIndex(index, size, [message], [template]) ⇒ <code>
|
|
1616
|
+
### ErrrValidator.checkElementIndex(index, size, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1617
1617
|
Ensures that index specifies a valid element in an array, list or string of size size.
|
|
1618
1618
|
|
|
1619
|
-
**Kind**: static method of <code>
|
|
1620
|
-
**Returns**: <code>
|
|
1619
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1620
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1621
1621
|
|
|
1622
1622
|
| Param | Type | Description |
|
|
1623
1623
|
| --- | --- | --- |
|
|
@@ -1628,11 +1628,11 @@ Ensures that index specifies a valid element in an array, list or string of size
|
|
|
1628
1628
|
|
|
1629
1629
|
<a name="ErrrValidator.checkPositionIndex"></a>
|
|
1630
1630
|
|
|
1631
|
-
### ErrrValidator.checkPositionIndex(index, size, [message], [template]) ⇒ <code>
|
|
1631
|
+
### ErrrValidator.checkPositionIndex(index, size, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1632
1632
|
Ensures that index specifies a valid position in an array, list or string of size size.
|
|
1633
1633
|
|
|
1634
|
-
**Kind**: static method of <code>
|
|
1635
|
-
**Returns**: <code>
|
|
1634
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1635
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1636
1636
|
|
|
1637
1637
|
| Param | Type | Description |
|
|
1638
1638
|
| --- | --- | --- |
|
|
@@ -1643,11 +1643,11 @@ Ensures that index specifies a valid position in an array, list or string of siz
|
|
|
1643
1643
|
|
|
1644
1644
|
<a name="ErrrValidator.checkPositionIndexes"></a>
|
|
1645
1645
|
|
|
1646
|
-
### ErrrValidator.checkPositionIndexes(start, end, size, [message], [template]) ⇒ <code>
|
|
1646
|
+
### ErrrValidator.checkPositionIndexes(start, end, size, [message], [template]) ⇒ [<code>ErrrDecorator</code>](#ErrrDecorator)
|
|
1647
1647
|
Ensures that start and end specify a valid positions in an array, list or string of size size, and are in order.
|
|
1648
1648
|
|
|
1649
|
-
**Kind**: static method of <code>
|
|
1650
|
-
**Returns**: <code>
|
|
1649
|
+
**Kind**: static method of [<code>ErrrValidator</code>](#ErrrValidator)
|
|
1650
|
+
**Returns**: [<code>ErrrDecorator</code>](#ErrrDecorator) - - An object that decorates the errr node module.
|
|
1651
1651
|
|
|
1652
1652
|
| Param | Type | Description |
|
|
1653
1653
|
| --- | --- | --- |
|
|
@@ -1668,26 +1668,26 @@ Preconditions entry point interface.
|
|
|
1668
1668
|
* [.errr()](#Preconditions.errr) ⇒
|
|
1669
1669
|
* [.singleton()](#Preconditions.singleton) ⇒
|
|
1670
1670
|
* [.instance(objectUnderTest)](#Preconditions.instance) ⇒
|
|
1671
|
-
* [.
|
|
1671
|
+
* [.getConstructor()](#Preconditions.getConstructor) ⇒
|
|
1672
1672
|
|
|
1673
1673
|
<a name="Preconditions.errr"></a>
|
|
1674
1674
|
|
|
1675
1675
|
### Preconditions.errr() ⇒
|
|
1676
1676
|
Validate single value with the buildable errr interface from the static errr Validation functionality.
|
|
1677
1677
|
|
|
1678
|
-
**Kind**: static method of <code>
|
|
1678
|
+
**Kind**: static method of [<code>Preconditions</code>](#Preconditions)
|
|
1679
1679
|
**Returns**: Error Validation Singleton.
|
|
1680
1680
|
<a name="Preconditions.singleton"></a>
|
|
1681
1681
|
|
|
1682
1682
|
### Preconditions.singleton() ⇒
|
|
1683
1683
|
Validate single value with the chainable interface from the Error Validation Singleton.
|
|
1684
1684
|
|
|
1685
|
-
**Kind**: static method of <code>
|
|
1685
|
+
**Kind**: static method of [<code>Preconditions</code>](#Preconditions)
|
|
1686
1686
|
**Returns**: Error Validation Singleton.
|
|
1687
1687
|
<a name="Preconditions.instance"></a>
|
|
1688
1688
|
|
|
1689
1689
|
### Preconditions.instance(objectUnderTest) ⇒
|
|
1690
|
-
**Kind**: static method of <code>
|
|
1690
|
+
**Kind**: static method of [<code>Preconditions</code>](#Preconditions)
|
|
1691
1691
|
**Returns**: Error Validation instance.
|
|
1692
1692
|
**Warning**: This functionality has very poor performance. Please use the 'singleton' or 'errr' functionality instead.
|
|
1693
1693
|
|
|
@@ -1697,11 +1697,11 @@ Validate values of a given JSON object with the preconditions object.
|
|
|
1697
1697
|
| --- | --- |
|
|
1698
1698
|
| objectUnderTest | Object Under Test |
|
|
1699
1699
|
|
|
1700
|
-
<a name="Preconditions.
|
|
1700
|
+
<a name="Preconditions.getConstructor"></a>
|
|
1701
1701
|
|
|
1702
|
-
### Preconditions.
|
|
1702
|
+
### Preconditions.getConstructor() ⇒
|
|
1703
1703
|
Gives ability to extend and add other preconditions to the Error Validation constructor.
|
|
1704
1704
|
|
|
1705
|
-
**Kind**: static method of <code>
|
|
1705
|
+
**Kind**: static method of [<code>Preconditions</code>](#Preconditions)
|
|
1706
1706
|
**Returns**: Error Validation constructor.
|
|
1707
1707
|
**Warning**: This functionality only works with the 'instance' function which has very poor performance.
|