@twin.org/core 0.0.3-next.3 → 0.0.3-next.31
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 +1 -9
- package/dist/es/encoding/base32.js +1 -1
- package/dist/es/encoding/base32.js.map +1 -1
- package/dist/es/factories/factory.js +41 -0
- package/dist/es/factories/factory.js.map +1 -1
- package/dist/es/helpers/arrayHelper.js.map +1 -1
- package/dist/es/helpers/randomHelper.js +50 -2
- package/dist/es/helpers/randomHelper.js.map +1 -1
- package/dist/es/index.js +2 -1
- package/dist/es/index.js.map +1 -1
- package/dist/es/types/objectOrArray.js.map +1 -0
- package/dist/es/types/singleOccurrenceArray.js +2 -0
- package/dist/es/types/singleOccurrenceArray.js.map +1 -0
- package/dist/es/types/urn.js +1 -2
- package/dist/es/types/urn.js.map +1 -1
- package/dist/es/utils/asyncCache.js +102 -75
- package/dist/es/utils/asyncCache.js.map +1 -1
- package/dist/es/utils/guards.js +16 -0
- package/dist/es/utils/guards.js.map +1 -1
- package/dist/es/utils/is.js +16 -0
- package/dist/es/utils/is.js.map +1 -1
- package/dist/types/encoding/base32.d.ts +1 -1
- package/dist/types/factories/factory.d.ts +23 -1
- package/dist/types/helpers/arrayHelper.d.ts +1 -1
- package/dist/types/helpers/randomHelper.d.ts +16 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/types/singleOccurrenceArray.d.ts +9 -0
- package/dist/types/utils/asyncCache.d.ts +7 -0
- package/dist/types/utils/guards.d.ts +10 -1
- package/dist/types/utils/is.d.ts +7 -0
- package/docs/changelog.md +541 -1
- package/docs/examples.md +308 -1
- package/docs/reference/classes/AlreadyExistsError.md +35 -35
- package/docs/reference/classes/ArrayHelper.md +2 -2
- package/docs/reference/classes/AsyncCache.md +8 -8
- package/docs/reference/classes/Base32.md +4 -4
- package/docs/reference/classes/Base58.md +3 -3
- package/docs/reference/classes/Base64.md +4 -4
- package/docs/reference/classes/Base64Url.md +3 -3
- package/docs/reference/classes/BaseError.md +34 -34
- package/docs/reference/classes/BitString.md +6 -6
- package/docs/reference/classes/Coerce.md +11 -11
- package/docs/reference/classes/Compression.md +3 -3
- package/docs/reference/classes/ConflictError.md +35 -35
- package/docs/reference/classes/Converter.md +18 -18
- package/docs/reference/classes/EnvHelper.md +1 -1
- package/docs/reference/classes/ErrorHelper.md +3 -3
- package/docs/reference/classes/Factory.md +112 -18
- package/docs/reference/classes/FilenameHelper.md +1 -1
- package/docs/reference/classes/GeneralError.md +35 -35
- package/docs/reference/classes/GuardError.md +35 -35
- package/docs/reference/classes/Guards.md +72 -30
- package/docs/reference/classes/HexHelper.md +6 -6
- package/docs/reference/classes/I18n.md +14 -14
- package/docs/reference/classes/Is.md +67 -39
- package/docs/reference/classes/JsonHelper.md +10 -10
- package/docs/reference/classes/NotFoundError.md +35 -35
- package/docs/reference/classes/NotImplementedError.md +35 -35
- package/docs/reference/classes/NotSupportedError.md +35 -35
- package/docs/reference/classes/NumberHelper.md +2 -2
- package/docs/reference/classes/ObjectHelper.md +32 -32
- package/docs/reference/classes/RandomHelper.md +53 -1
- package/docs/reference/classes/SharedStore.md +3 -3
- package/docs/reference/classes/StringHelper.md +23 -23
- package/docs/reference/classes/Uint8ArrayHelper.md +1 -1
- package/docs/reference/classes/UnauthorizedError.md +35 -35
- package/docs/reference/classes/UnprocessableError.md +35 -35
- package/docs/reference/classes/Url.md +8 -8
- package/docs/reference/classes/Urn.md +24 -24
- package/docs/reference/classes/Validation.md +25 -25
- package/docs/reference/classes/ValidationError.md +35 -35
- package/docs/reference/index.md +2 -0
- package/docs/reference/interfaces/IComponent.md +4 -4
- package/docs/reference/interfaces/IError.md +10 -10
- package/docs/reference/interfaces/II18nShared.md +4 -4
- package/docs/reference/interfaces/IKeyValue.md +2 -2
- package/docs/reference/interfaces/ILabelledValue.md +2 -2
- package/docs/reference/interfaces/ILocale.md +2 -2
- package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
- package/docs/reference/interfaces/ILocalesIndex.md +1 -1
- package/docs/reference/interfaces/IPatchOperation.md +6 -6
- package/docs/reference/interfaces/IUrlParts.md +9 -9
- package/docs/reference/interfaces/IValidationFailure.md +4 -4
- package/docs/reference/type-aliases/SingleOccurrenceArray.md +15 -0
- package/docs/reference/type-aliases/SingleOccurrenceArrayDepthHelper.md +19 -0
- package/docs/reference/variables/CoerceType.md +10 -10
- package/docs/reference/variables/CompressionType.md +2 -2
- package/locales/en.json +5 -2
- package/package.json +4 -4
- package/dist/es/models/objectOrArray.js.map +0 -1
- /package/dist/es/{models → types}/objectOrArray.js +0 -0
- /package/dist/types/{models → types}/objectOrArray.d.ts +0 -0
|
@@ -14,7 +14,7 @@ Class to check types of objects.
|
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
|
-
### undefined()
|
|
17
|
+
### undefined() {#undefined}
|
|
18
18
|
|
|
19
19
|
> `static` **undefined**(`value`): `value is undefined`
|
|
20
20
|
|
|
@@ -36,7 +36,7 @@ True if the value is a empty.
|
|
|
36
36
|
|
|
37
37
|
***
|
|
38
38
|
|
|
39
|
-
### null()
|
|
39
|
+
### null() {#null}
|
|
40
40
|
|
|
41
41
|
> `static` **null**(`value`): `value is null`
|
|
42
42
|
|
|
@@ -58,7 +58,7 @@ True if the value is a empty.
|
|
|
58
58
|
|
|
59
59
|
***
|
|
60
60
|
|
|
61
|
-
### empty()
|
|
61
|
+
### empty() {#empty}
|
|
62
62
|
|
|
63
63
|
> `static` **empty**(`value`): value is null \| undefined
|
|
64
64
|
|
|
@@ -80,7 +80,7 @@ True if the value is a empty.
|
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
83
|
-
### notEmpty()
|
|
83
|
+
### notEmpty() {#notempty}
|
|
84
84
|
|
|
85
85
|
> `static` **notEmpty**(`value`): `boolean`
|
|
86
86
|
|
|
@@ -102,7 +102,7 @@ True if the value is a not empty.
|
|
|
102
102
|
|
|
103
103
|
***
|
|
104
104
|
|
|
105
|
-
### string()
|
|
105
|
+
### string() {#string}
|
|
106
106
|
|
|
107
107
|
> `static` **string**(`value`): `value is string`
|
|
108
108
|
|
|
@@ -124,7 +124,7 @@ True if the value is a string.
|
|
|
124
124
|
|
|
125
125
|
***
|
|
126
126
|
|
|
127
|
-
### stringValue()
|
|
127
|
+
### stringValue() {#stringvalue}
|
|
128
128
|
|
|
129
129
|
> `static` **stringValue**(`value`): `value is string`
|
|
130
130
|
|
|
@@ -146,7 +146,7 @@ True if the value is a string.
|
|
|
146
146
|
|
|
147
147
|
***
|
|
148
148
|
|
|
149
|
-
### json()
|
|
149
|
+
### json() {#json}
|
|
150
150
|
|
|
151
151
|
> `static` **json**(`value`): `value is string`
|
|
152
152
|
|
|
@@ -168,7 +168,7 @@ True if the value is a JSON string.
|
|
|
168
168
|
|
|
169
169
|
***
|
|
170
170
|
|
|
171
|
-
### stringBase64()
|
|
171
|
+
### stringBase64() {#stringbase64}
|
|
172
172
|
|
|
173
173
|
> `static` **stringBase64**(`value`): `value is string`
|
|
174
174
|
|
|
@@ -190,7 +190,7 @@ True if the value is a base64 string.
|
|
|
190
190
|
|
|
191
191
|
***
|
|
192
192
|
|
|
193
|
-
### stringBase64Url()
|
|
193
|
+
### stringBase64Url() {#stringbase64url}
|
|
194
194
|
|
|
195
195
|
> `static` **stringBase64Url**(`value`): `value is string`
|
|
196
196
|
|
|
@@ -212,7 +212,7 @@ True if the value is a base64 string.
|
|
|
212
212
|
|
|
213
213
|
***
|
|
214
214
|
|
|
215
|
-
### stringBase58()
|
|
215
|
+
### stringBase58() {#stringbase58}
|
|
216
216
|
|
|
217
217
|
> `static` **stringBase58**(`value`): `value is string`
|
|
218
218
|
|
|
@@ -234,9 +234,9 @@ True if the value is a base58 string.
|
|
|
234
234
|
|
|
235
235
|
***
|
|
236
236
|
|
|
237
|
-
### stringHex()
|
|
237
|
+
### stringHex() {#stringhex}
|
|
238
238
|
|
|
239
|
-
> `static` **stringHex**(`value`, `allowPrefix
|
|
239
|
+
> `static` **stringHex**(`value`, `allowPrefix?`): `value is string`
|
|
240
240
|
|
|
241
241
|
Is the value a hex string.
|
|
242
242
|
|
|
@@ -248,7 +248,7 @@ Is the value a hex string.
|
|
|
248
248
|
|
|
249
249
|
The value to test.
|
|
250
250
|
|
|
251
|
-
##### allowPrefix
|
|
251
|
+
##### allowPrefix?
|
|
252
252
|
|
|
253
253
|
`boolean` = `false`
|
|
254
254
|
|
|
@@ -262,9 +262,9 @@ True if the value is a hex string.
|
|
|
262
262
|
|
|
263
263
|
***
|
|
264
264
|
|
|
265
|
-
### stringHexLength()
|
|
265
|
+
### stringHexLength() {#stringhexlength}
|
|
266
266
|
|
|
267
|
-
> `static` **stringHexLength**(`value`, `length`, `allowPrefix
|
|
267
|
+
> `static` **stringHexLength**(`value`, `length`, `allowPrefix?`): `value is string`
|
|
268
268
|
|
|
269
269
|
Is the value a hex string of fixed length.
|
|
270
270
|
|
|
@@ -282,7 +282,7 @@ The value to test.
|
|
|
282
282
|
|
|
283
283
|
The length to test.
|
|
284
284
|
|
|
285
|
-
##### allowPrefix
|
|
285
|
+
##### allowPrefix?
|
|
286
286
|
|
|
287
287
|
`boolean` = `false`
|
|
288
288
|
|
|
@@ -296,7 +296,7 @@ True if the value is a hex string of required length.
|
|
|
296
296
|
|
|
297
297
|
***
|
|
298
298
|
|
|
299
|
-
### number()
|
|
299
|
+
### number() {#number}
|
|
300
300
|
|
|
301
301
|
> `static` **number**(`value`): `value is number`
|
|
302
302
|
|
|
@@ -318,7 +318,7 @@ True if the value is a number.
|
|
|
318
318
|
|
|
319
319
|
***
|
|
320
320
|
|
|
321
|
-
### integer()
|
|
321
|
+
### integer() {#integer}
|
|
322
322
|
|
|
323
323
|
> `static` **integer**(`value`): `value is number`
|
|
324
324
|
|
|
@@ -340,7 +340,7 @@ True if the value is an integer.
|
|
|
340
340
|
|
|
341
341
|
***
|
|
342
342
|
|
|
343
|
-
### bigint()
|
|
343
|
+
### bigint() {#bigint}
|
|
344
344
|
|
|
345
345
|
> `static` **bigint**(`value`): `value is bigint`
|
|
346
346
|
|
|
@@ -362,7 +362,7 @@ True if the value is a big integer.
|
|
|
362
362
|
|
|
363
363
|
***
|
|
364
364
|
|
|
365
|
-
### boolean()
|
|
365
|
+
### boolean() {#boolean}
|
|
366
366
|
|
|
367
367
|
> `static` **boolean**(`value`): `value is boolean`
|
|
368
368
|
|
|
@@ -384,7 +384,7 @@ True if the value is a boolean.
|
|
|
384
384
|
|
|
385
385
|
***
|
|
386
386
|
|
|
387
|
-
### date()
|
|
387
|
+
### date() {#date}
|
|
388
388
|
|
|
389
389
|
> `static` **date**(`value`): `value is Date`
|
|
390
390
|
|
|
@@ -406,7 +406,7 @@ True if the value is a date.
|
|
|
406
406
|
|
|
407
407
|
***
|
|
408
408
|
|
|
409
|
-
### dateEmpty()
|
|
409
|
+
### dateEmpty() {#dateempty}
|
|
410
410
|
|
|
411
411
|
> `static` **dateEmpty**(`value`): `boolean`
|
|
412
412
|
|
|
@@ -428,7 +428,7 @@ True if the value is an empty date.
|
|
|
428
428
|
|
|
429
429
|
***
|
|
430
430
|
|
|
431
|
-
### dateString()
|
|
431
|
+
### dateString() {#datestring}
|
|
432
432
|
|
|
433
433
|
> `static` **dateString**(`value`): `boolean`
|
|
434
434
|
|
|
@@ -450,7 +450,7 @@ True if the value is a string in ISO 8601 date format.
|
|
|
450
450
|
|
|
451
451
|
***
|
|
452
452
|
|
|
453
|
-
### dateTimeString()
|
|
453
|
+
### dateTimeString() {#datetimestring}
|
|
454
454
|
|
|
455
455
|
> `static` **dateTimeString**(`value`): `boolean`
|
|
456
456
|
|
|
@@ -472,7 +472,7 @@ True if the value is a string in ISO 8601 date/time format.
|
|
|
472
472
|
|
|
473
473
|
***
|
|
474
474
|
|
|
475
|
-
### timeString()
|
|
475
|
+
### timeString() {#timestring}
|
|
476
476
|
|
|
477
477
|
> `static` **timeString**(`value`): `boolean`
|
|
478
478
|
|
|
@@ -494,7 +494,7 @@ True if the value is a string in ISO 8601 time format.
|
|
|
494
494
|
|
|
495
495
|
***
|
|
496
496
|
|
|
497
|
-
### timestampSeconds()
|
|
497
|
+
### timestampSeconds() {#timestampseconds}
|
|
498
498
|
|
|
499
499
|
> `static` **timestampSeconds**(`value`): `value is number`
|
|
500
500
|
|
|
@@ -516,7 +516,7 @@ True if the value is a date.
|
|
|
516
516
|
|
|
517
517
|
***
|
|
518
518
|
|
|
519
|
-
### timestampMilliseconds()
|
|
519
|
+
### timestampMilliseconds() {#timestampmilliseconds}
|
|
520
520
|
|
|
521
521
|
> `static` **timestampMilliseconds**(`value`): `value is number`
|
|
522
522
|
|
|
@@ -538,7 +538,7 @@ True if the value is a date.
|
|
|
538
538
|
|
|
539
539
|
***
|
|
540
540
|
|
|
541
|
-
### object()
|
|
541
|
+
### object() {#object}
|
|
542
542
|
|
|
543
543
|
> `static` **object**\<`T`\>(`value`): `value is T`
|
|
544
544
|
|
|
@@ -566,7 +566,7 @@ True if the value is a object.
|
|
|
566
566
|
|
|
567
567
|
***
|
|
568
568
|
|
|
569
|
-
### objectValue()
|
|
569
|
+
### objectValue() {#objectvalue}
|
|
570
570
|
|
|
571
571
|
> `static` **objectValue**\<`T`\>(`value`): `value is T`
|
|
572
572
|
|
|
@@ -594,7 +594,7 @@ True if the value is a object.
|
|
|
594
594
|
|
|
595
595
|
***
|
|
596
596
|
|
|
597
|
-
### array()
|
|
597
|
+
### array() {#array}
|
|
598
598
|
|
|
599
599
|
> `static` **array**\<`T`\>(`value`): `value is T[]`
|
|
600
600
|
|
|
@@ -622,7 +622,7 @@ True if the value is an array.
|
|
|
622
622
|
|
|
623
623
|
***
|
|
624
624
|
|
|
625
|
-
### arrayValue()
|
|
625
|
+
### arrayValue() {#arrayvalue}
|
|
626
626
|
|
|
627
627
|
> `static` **arrayValue**\<`T`\>(`value`): `value is T[]`
|
|
628
628
|
|
|
@@ -650,7 +650,7 @@ True if the value is an array with at least one element.
|
|
|
650
650
|
|
|
651
651
|
***
|
|
652
652
|
|
|
653
|
-
### arrayOneOf()
|
|
653
|
+
### arrayOneOf() {#arrayoneof}
|
|
654
654
|
|
|
655
655
|
> `static` **arrayOneOf**\<`T`\>(`value`, `options`): `value is T`
|
|
656
656
|
|
|
@@ -684,7 +684,7 @@ True if the value is an element from the options array.
|
|
|
684
684
|
|
|
685
685
|
***
|
|
686
686
|
|
|
687
|
-
### uint8Array()
|
|
687
|
+
### uint8Array() {#uint8array}
|
|
688
688
|
|
|
689
689
|
> `static` **uint8Array**(`value`): `value is Uint8Array<ArrayBufferLike>`
|
|
690
690
|
|
|
@@ -706,7 +706,7 @@ True if the value is a Uint8Array.
|
|
|
706
706
|
|
|
707
707
|
***
|
|
708
708
|
|
|
709
|
-
### typedArray()
|
|
709
|
+
### typedArray() {#typedarray}
|
|
710
710
|
|
|
711
711
|
> `static` **typedArray**(`value`): value is Uint8Array\<ArrayBufferLike\> \| Int8Array\<ArrayBufferLike\> \| Uint16Array\<ArrayBufferLike\> \| Int16Array\<ArrayBufferLike\> \| Uint32Array\<ArrayBufferLike\> \| Int32Array\<ArrayBufferLike\> \| Float32Array\<ArrayBufferLike\> \| Float64Array\<ArrayBufferLike\>
|
|
712
712
|
|
|
@@ -728,7 +728,7 @@ True if the value is a TypedArray.
|
|
|
728
728
|
|
|
729
729
|
***
|
|
730
730
|
|
|
731
|
-
### function()
|
|
731
|
+
### function() {#function}
|
|
732
732
|
|
|
733
733
|
> `static` **function**\<`T`\>(`value`): `value is T`
|
|
734
734
|
|
|
@@ -756,7 +756,7 @@ True if the value is a function.
|
|
|
756
756
|
|
|
757
757
|
***
|
|
758
758
|
|
|
759
|
-
### email()
|
|
759
|
+
### email() {#email}
|
|
760
760
|
|
|
761
761
|
> `static` **email**(`value`): `value is string`
|
|
762
762
|
|
|
@@ -778,7 +778,7 @@ True if the value is a string.
|
|
|
778
778
|
|
|
779
779
|
***
|
|
780
780
|
|
|
781
|
-
### promise()
|
|
781
|
+
### promise() {#promise}
|
|
782
782
|
|
|
783
783
|
> `static` **promise**\<`T`\>(`value`): `value is Promise<T>`
|
|
784
784
|
|
|
@@ -806,7 +806,7 @@ True if the value is a promise.
|
|
|
806
806
|
|
|
807
807
|
***
|
|
808
808
|
|
|
809
|
-
### regexp()
|
|
809
|
+
### regexp() {#regexp}
|
|
810
810
|
|
|
811
811
|
> `static` **regexp**(`value`): `value is RegExp`
|
|
812
812
|
|
|
@@ -828,7 +828,7 @@ True if the value is a regexp.
|
|
|
828
828
|
|
|
829
829
|
***
|
|
830
830
|
|
|
831
|
-
### class()
|
|
831
|
+
### class() {#class}
|
|
832
832
|
|
|
833
833
|
> `static` **class**\<`T`\>(`obj`): `obj is (args: any[]) => T`
|
|
834
834
|
|
|
@@ -853,3 +853,31 @@ The object to check.
|
|
|
853
853
|
`obj is (args: any[]) => T`
|
|
854
854
|
|
|
855
855
|
True if the object is a class, false otherwise.
|
|
856
|
+
|
|
857
|
+
***
|
|
858
|
+
|
|
859
|
+
### uuidV7() {#uuidv7}
|
|
860
|
+
|
|
861
|
+
> `static` **uuidV7**(`value`, `format?`): `value is string`
|
|
862
|
+
|
|
863
|
+
Is the value a uuidV7 string.
|
|
864
|
+
|
|
865
|
+
#### Parameters
|
|
866
|
+
|
|
867
|
+
##### value
|
|
868
|
+
|
|
869
|
+
`unknown`
|
|
870
|
+
|
|
871
|
+
The value to test.
|
|
872
|
+
|
|
873
|
+
##### format?
|
|
874
|
+
|
|
875
|
+
`"standard"` \| `"compact"`
|
|
876
|
+
|
|
877
|
+
The format of the UUIDv7 string.
|
|
878
|
+
|
|
879
|
+
#### Returns
|
|
880
|
+
|
|
881
|
+
`value is string`
|
|
882
|
+
|
|
883
|
+
True if the value is a uuidV7 string.
|
|
@@ -14,7 +14,7 @@ Helpers methods for JSON objects.
|
|
|
14
14
|
|
|
15
15
|
## Properties
|
|
16
16
|
|
|
17
|
-
### CLASS\_NAME
|
|
17
|
+
### CLASS\_NAME {#class_name}
|
|
18
18
|
|
|
19
19
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
20
|
|
|
@@ -22,7 +22,7 @@ Runtime name for the class.
|
|
|
22
22
|
|
|
23
23
|
## Methods
|
|
24
24
|
|
|
25
|
-
### canonicalize()
|
|
25
|
+
### canonicalize() {#canonicalize}
|
|
26
26
|
|
|
27
27
|
> `static` **canonicalize**(`object`): `string`
|
|
28
28
|
|
|
@@ -45,7 +45,7 @@ The serialized object.
|
|
|
45
45
|
|
|
46
46
|
***
|
|
47
47
|
|
|
48
|
-
### diff()
|
|
48
|
+
### diff() {#diff}
|
|
49
49
|
|
|
50
50
|
> `static` **diff**\<`T`\>(`object1`, `object2`): [`IPatchOperation`](../interfaces/IPatchOperation.md)[]
|
|
51
51
|
|
|
@@ -80,7 +80,7 @@ The list of patches.
|
|
|
80
80
|
|
|
81
81
|
***
|
|
82
82
|
|
|
83
|
-
### patch()
|
|
83
|
+
### patch() {#patch}
|
|
84
84
|
|
|
85
85
|
> `static` **patch**\<`T`\>(`object`, `patches`): `T`
|
|
86
86
|
|
|
@@ -119,7 +119,7 @@ GeneralError if the patch fails.
|
|
|
119
119
|
|
|
120
120
|
***
|
|
121
121
|
|
|
122
|
-
### stringifyEx()
|
|
122
|
+
### stringifyEx() {#stringifyex}
|
|
123
123
|
|
|
124
124
|
> `static` **stringifyEx**(`object`, `space?`): `string`
|
|
125
125
|
|
|
@@ -135,9 +135,9 @@ The object to stringify.
|
|
|
135
135
|
|
|
136
136
|
##### space?
|
|
137
137
|
|
|
138
|
-
|
|
138
|
+
`string` \| `number`
|
|
139
139
|
|
|
140
|
-
|
|
140
|
+
Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.
|
|
141
141
|
|
|
142
142
|
#### Returns
|
|
143
143
|
|
|
@@ -147,7 +147,7 @@ The stringified object.
|
|
|
147
147
|
|
|
148
148
|
***
|
|
149
149
|
|
|
150
|
-
### parseEx()
|
|
150
|
+
### parseEx() {#parseex}
|
|
151
151
|
|
|
152
152
|
> `static` **parseEx**(`json`): `any`
|
|
153
153
|
|
|
@@ -169,7 +169,7 @@ The object.
|
|
|
169
169
|
|
|
170
170
|
***
|
|
171
171
|
|
|
172
|
-
### stringifyExReplacer()
|
|
172
|
+
### stringifyExReplacer() {#stringifyexreplacer}
|
|
173
173
|
|
|
174
174
|
> `static` **stringifyExReplacer**(`this`, `key`, `value`): `unknown`
|
|
175
175
|
|
|
@@ -203,7 +203,7 @@ The value.
|
|
|
203
203
|
|
|
204
204
|
***
|
|
205
205
|
|
|
206
|
-
### parseExReviver()
|
|
206
|
+
### parseExReviver() {#parseexreviver}
|
|
207
207
|
|
|
208
208
|
> `static` **parseExReviver**(`this`, `key`, `value`): `unknown`
|
|
209
209
|
|
|
@@ -54,9 +54,9 @@ The cause of the error if we have wrapped another error.
|
|
|
54
54
|
|
|
55
55
|
## Properties
|
|
56
56
|
|
|
57
|
-
### source?
|
|
57
|
+
### source? {#source}
|
|
58
58
|
|
|
59
|
-
> `optional` **source
|
|
59
|
+
> `optional` **source?**: `string`
|
|
60
60
|
|
|
61
61
|
The source of the error.
|
|
62
62
|
|
|
@@ -66,9 +66,9 @@ The source of the error.
|
|
|
66
66
|
|
|
67
67
|
***
|
|
68
68
|
|
|
69
|
-
### properties?
|
|
69
|
+
### properties? {#properties}
|
|
70
70
|
|
|
71
|
-
> `optional` **properties
|
|
71
|
+
> `optional` **properties?**: `object`
|
|
72
72
|
|
|
73
73
|
Any additional information for the error.
|
|
74
74
|
|
|
@@ -82,9 +82,9 @@ Any additional information for the error.
|
|
|
82
82
|
|
|
83
83
|
***
|
|
84
84
|
|
|
85
|
-
### cause?
|
|
85
|
+
### cause? {#cause}
|
|
86
86
|
|
|
87
|
-
> `optional` **cause
|
|
87
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
88
88
|
|
|
89
89
|
The cause of the error.
|
|
90
90
|
|
|
@@ -94,7 +94,7 @@ The cause of the error.
|
|
|
94
94
|
|
|
95
95
|
***
|
|
96
96
|
|
|
97
|
-
### CLASS\_NAME
|
|
97
|
+
### CLASS\_NAME {#class_name}
|
|
98
98
|
|
|
99
99
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
100
100
|
|
|
@@ -102,7 +102,7 @@ Runtime name for the class.
|
|
|
102
102
|
|
|
103
103
|
## Methods
|
|
104
104
|
|
|
105
|
-
### fromError()
|
|
105
|
+
### fromError() {#fromerror}
|
|
106
106
|
|
|
107
107
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
108
108
|
|
|
@@ -128,7 +128,7 @@ The new instance.
|
|
|
128
128
|
|
|
129
129
|
***
|
|
130
130
|
|
|
131
|
-
### flatten()
|
|
131
|
+
### flatten() {#flatten}
|
|
132
132
|
|
|
133
133
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
134
134
|
|
|
@@ -154,7 +154,7 @@ The list of all internal errors.
|
|
|
154
154
|
|
|
155
155
|
***
|
|
156
156
|
|
|
157
|
-
### expand()
|
|
157
|
+
### expand() {#expand}
|
|
158
158
|
|
|
159
159
|
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
160
160
|
|
|
@@ -164,9 +164,9 @@ Expand an error tree.
|
|
|
164
164
|
|
|
165
165
|
##### errors
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
168
168
|
|
|
169
|
-
|
|
169
|
+
The list of errors to expand.
|
|
170
170
|
|
|
171
171
|
#### Returns
|
|
172
172
|
|
|
@@ -180,7 +180,7 @@ The first level error.
|
|
|
180
180
|
|
|
181
181
|
***
|
|
182
182
|
|
|
183
|
-
### isErrorName()
|
|
183
|
+
### isErrorName() {#iserrorname}
|
|
184
184
|
|
|
185
185
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
186
186
|
|
|
@@ -196,9 +196,9 @@ The error to test.
|
|
|
196
196
|
|
|
197
197
|
##### name
|
|
198
198
|
|
|
199
|
-
|
|
199
|
+
`string` \| `RegExp`
|
|
200
200
|
|
|
201
|
-
|
|
201
|
+
The name to check for.
|
|
202
202
|
|
|
203
203
|
#### Returns
|
|
204
204
|
|
|
@@ -212,7 +212,7 @@ True if the error has the name.
|
|
|
212
212
|
|
|
213
213
|
***
|
|
214
214
|
|
|
215
|
-
### isErrorMessage()
|
|
215
|
+
### isErrorMessage() {#iserrormessage}
|
|
216
216
|
|
|
217
217
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
218
218
|
|
|
@@ -228,9 +228,9 @@ The error to test.
|
|
|
228
228
|
|
|
229
229
|
##### message
|
|
230
230
|
|
|
231
|
-
|
|
231
|
+
`string` \| `RegExp`
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
The message to check for.
|
|
234
234
|
|
|
235
235
|
#### Returns
|
|
236
236
|
|
|
@@ -244,7 +244,7 @@ True if the error has the name.
|
|
|
244
244
|
|
|
245
245
|
***
|
|
246
246
|
|
|
247
|
-
### isErrorCode()
|
|
247
|
+
### isErrorCode() {#iserrorcode}
|
|
248
248
|
|
|
249
249
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
250
250
|
|
|
@@ -260,9 +260,9 @@ The error to test.
|
|
|
260
260
|
|
|
261
261
|
##### code
|
|
262
262
|
|
|
263
|
-
|
|
263
|
+
`string` \| `RegExp`
|
|
264
264
|
|
|
265
|
-
|
|
265
|
+
The code to check for.
|
|
266
266
|
|
|
267
267
|
#### Returns
|
|
268
268
|
|
|
@@ -276,7 +276,7 @@ True if the error has the code.
|
|
|
276
276
|
|
|
277
277
|
***
|
|
278
278
|
|
|
279
|
-
### someErrorName()
|
|
279
|
+
### someErrorName() {#someerrorname}
|
|
280
280
|
|
|
281
281
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
282
282
|
|
|
@@ -292,9 +292,9 @@ The error to test.
|
|
|
292
292
|
|
|
293
293
|
##### name
|
|
294
294
|
|
|
295
|
-
|
|
295
|
+
`string` \| `RegExp`
|
|
296
296
|
|
|
297
|
-
|
|
297
|
+
The name to check for.
|
|
298
298
|
|
|
299
299
|
#### Returns
|
|
300
300
|
|
|
@@ -308,7 +308,7 @@ True if the error has the name.
|
|
|
308
308
|
|
|
309
309
|
***
|
|
310
310
|
|
|
311
|
-
### someErrorMessage()
|
|
311
|
+
### someErrorMessage() {#someerrormessage}
|
|
312
312
|
|
|
313
313
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
314
314
|
|
|
@@ -324,9 +324,9 @@ The error to test.
|
|
|
324
324
|
|
|
325
325
|
##### message
|
|
326
326
|
|
|
327
|
-
|
|
327
|
+
`string` \| `RegExp`
|
|
328
328
|
|
|
329
|
-
|
|
329
|
+
The message to check for.
|
|
330
330
|
|
|
331
331
|
#### Returns
|
|
332
332
|
|
|
@@ -340,7 +340,7 @@ True if the error has the name.
|
|
|
340
340
|
|
|
341
341
|
***
|
|
342
342
|
|
|
343
|
-
### someErrorClass()
|
|
343
|
+
### someErrorClass() {#someerrorclass}
|
|
344
344
|
|
|
345
345
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
346
346
|
|
|
@@ -372,7 +372,7 @@ True if the error has the specific class.
|
|
|
372
372
|
|
|
373
373
|
***
|
|
374
374
|
|
|
375
|
-
### someErrorCode()
|
|
375
|
+
### someErrorCode() {#someerrorcode}
|
|
376
376
|
|
|
377
377
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
378
378
|
|
|
@@ -388,9 +388,9 @@ The error to test.
|
|
|
388
388
|
|
|
389
389
|
##### code
|
|
390
390
|
|
|
391
|
-
|
|
391
|
+
`string` \| `RegExp`
|
|
392
392
|
|
|
393
|
-
|
|
393
|
+
The code to check for.
|
|
394
394
|
|
|
395
395
|
#### Returns
|
|
396
396
|
|
|
@@ -404,7 +404,7 @@ True if the error has the name.
|
|
|
404
404
|
|
|
405
405
|
***
|
|
406
406
|
|
|
407
|
-
### isEmpty()
|
|
407
|
+
### isEmpty() {#isempty}
|
|
408
408
|
|
|
409
409
|
> `static` **isEmpty**(`err`): `boolean`
|
|
410
410
|
|
|
@@ -430,7 +430,7 @@ True if the error is empty.
|
|
|
430
430
|
|
|
431
431
|
***
|
|
432
432
|
|
|
433
|
-
### isAggregateError()
|
|
433
|
+
### isAggregateError() {#isaggregateerror}
|
|
434
434
|
|
|
435
435
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
436
436
|
|
|
@@ -456,7 +456,7 @@ True if the error is an aggregate error.
|
|
|
456
456
|
|
|
457
457
|
***
|
|
458
458
|
|
|
459
|
-
### fromAggregate()
|
|
459
|
+
### fromAggregate() {#fromaggregate}
|
|
460
460
|
|
|
461
461
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
462
462
|
|
|
@@ -488,7 +488,7 @@ The array of errors.
|
|
|
488
488
|
|
|
489
489
|
***
|
|
490
490
|
|
|
491
|
-
### toJsonObject()
|
|
491
|
+
### toJsonObject() {#tojsonobject}
|
|
492
492
|
|
|
493
493
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
494
494
|
|