@twin.org/core 0.0.1-next.5 → 0.0.1-next.51
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/dist/cjs/index.cjs +1401 -736
- package/dist/esm/index.mjs +1398 -737
- package/dist/types/encoding/base58.d.ts +18 -0
- package/dist/types/factories/factory.d.ts +20 -1
- package/dist/types/helpers/envHelper.d.ts +16 -0
- package/dist/types/helpers/jsonHelper.d.ts +30 -0
- package/dist/types/helpers/objectHelper.d.ts +33 -0
- package/dist/types/helpers/uint8ArrayHelper.d.ts +11 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/models/IComponent.d.ts +12 -3
- package/dist/types/models/coerceType.d.ts +49 -0
- package/dist/types/models/compressionType.d.ts +1 -1
- package/dist/types/utils/asyncCache.d.ts +8 -0
- package/dist/types/utils/coerce.d.ts +22 -0
- package/dist/types/utils/converter.d.ts +12 -0
- package/dist/types/utils/guards.d.ts +16 -0
- package/dist/types/utils/is.d.ts +12 -0
- package/dist/types/utils/validation.d.ts +2 -0
- package/docs/changelog.md +15 -1
- package/docs/reference/classes/AlreadyExistsError.md +67 -25
- package/docs/reference/classes/ArrayHelper.md +6 -2
- package/docs/reference/classes/AsyncCache.md +56 -6
- package/docs/reference/classes/Base32.md +6 -2
- package/docs/reference/classes/Base58.md +61 -0
- package/docs/reference/classes/Base64.md +9 -3
- package/docs/reference/classes/Base64Url.md +6 -2
- package/docs/reference/classes/BaseError.md +65 -23
- package/docs/reference/classes/BitString.md +18 -6
- package/docs/reference/classes/Coerce.md +104 -8
- package/docs/reference/classes/Compression.md +16 -8
- package/docs/reference/classes/ConflictError.md +70 -26
- package/docs/reference/classes/Converter.md +104 -20
- package/docs/reference/classes/EnvHelper.md +43 -0
- package/docs/reference/classes/ErrorHelper.md +9 -3
- package/docs/reference/classes/Factory.md +78 -10
- package/docs/reference/classes/FilenameHelper.md +3 -1
- package/docs/reference/classes/GeneralError.md +65 -25
- package/docs/reference/classes/GuardError.md +70 -26
- package/docs/reference/classes/Guards.md +286 -74
- package/docs/reference/classes/HexHelper.md +15 -5
- package/docs/reference/classes/I18n.md +42 -16
- package/docs/reference/classes/Is.md +160 -44
- package/docs/reference/classes/JsonHelper.md +137 -5
- package/docs/reference/classes/NotFoundError.md +67 -25
- package/docs/reference/classes/NotImplementedError.md +61 -23
- package/docs/reference/classes/NotSupportedError.md +64 -24
- package/docs/reference/classes/ObjectHelper.md +188 -20
- package/docs/reference/classes/RandomHelper.md +3 -1
- package/docs/reference/classes/StringHelper.md +51 -17
- package/docs/reference/classes/Uint8ArrayHelper.md +35 -0
- package/docs/reference/classes/UnauthorizedError.md +64 -24
- package/docs/reference/classes/UnprocessableError.md +65 -25
- package/docs/reference/classes/Url.md +30 -10
- package/docs/reference/classes/Urn.md +54 -18
- package/docs/reference/classes/Validation.md +315 -109
- package/docs/reference/classes/ValidationError.md +64 -24
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IComponent.md +30 -8
- package/docs/reference/interfaces/IError.md +1 -1
- package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
- package/docs/reference/interfaces/IValidationFailure.md +1 -1
- package/docs/reference/type-aliases/CoerceType.md +5 -0
- package/docs/reference/variables/CoerceType.md +67 -0
- package/docs/reference/variables/CompressionType.md +1 -1
- package/locales/en.json +21 -1
- package/package.json +6 -6
|
@@ -22,15 +22,21 @@ Encode a raw array to UTF8 string.
|
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### array
|
|
26
|
+
|
|
27
|
+
`ArrayLike`\<`number`\>
|
|
26
28
|
|
|
27
29
|
The bytes to encode.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
##### startIndex?
|
|
32
|
+
|
|
33
|
+
`number`
|
|
30
34
|
|
|
31
35
|
The index to start in the bytes.
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
##### length?
|
|
38
|
+
|
|
39
|
+
`number`
|
|
34
40
|
|
|
35
41
|
The length of bytes to read.
|
|
36
42
|
|
|
@@ -50,7 +56,9 @@ Convert a UTF8 string to raw array.
|
|
|
50
56
|
|
|
51
57
|
#### Parameters
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
##### utf8
|
|
60
|
+
|
|
61
|
+
`string`
|
|
54
62
|
|
|
55
63
|
The text to decode.
|
|
56
64
|
|
|
@@ -70,23 +78,33 @@ Encode a raw array to hex string.
|
|
|
70
78
|
|
|
71
79
|
#### Parameters
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
##### array
|
|
82
|
+
|
|
83
|
+
`ArrayLike`\<`number`\>
|
|
74
84
|
|
|
75
85
|
The bytes to encode.
|
|
76
86
|
|
|
77
|
-
|
|
87
|
+
##### includePrefix
|
|
88
|
+
|
|
89
|
+
`boolean` = `false`
|
|
78
90
|
|
|
79
91
|
Include the 0x prefix on the returned hex.
|
|
80
92
|
|
|
81
|
-
|
|
93
|
+
##### startIndex?
|
|
94
|
+
|
|
95
|
+
`number`
|
|
82
96
|
|
|
83
97
|
The index to start in the bytes.
|
|
84
98
|
|
|
85
|
-
|
|
99
|
+
##### length?
|
|
100
|
+
|
|
101
|
+
`number`
|
|
86
102
|
|
|
87
103
|
The length of bytes to read.
|
|
88
104
|
|
|
89
|
-
|
|
105
|
+
##### reverse?
|
|
106
|
+
|
|
107
|
+
`boolean`
|
|
90
108
|
|
|
91
109
|
Reverse the combine direction.
|
|
92
110
|
|
|
@@ -106,11 +124,15 @@ Decode a hex string to raw array.
|
|
|
106
124
|
|
|
107
125
|
#### Parameters
|
|
108
126
|
|
|
109
|
-
|
|
127
|
+
##### hex
|
|
128
|
+
|
|
129
|
+
`string`
|
|
110
130
|
|
|
111
131
|
The hex to decode.
|
|
112
132
|
|
|
113
|
-
|
|
133
|
+
##### reverse?
|
|
134
|
+
|
|
135
|
+
`boolean`
|
|
114
136
|
|
|
115
137
|
Store the characters in reverse.
|
|
116
138
|
|
|
@@ -130,11 +152,15 @@ Convert the UTF8 to hex.
|
|
|
130
152
|
|
|
131
153
|
#### Parameters
|
|
132
154
|
|
|
133
|
-
|
|
155
|
+
##### utf8
|
|
156
|
+
|
|
157
|
+
`string`
|
|
134
158
|
|
|
135
159
|
The text to convert.
|
|
136
160
|
|
|
137
|
-
|
|
161
|
+
##### includePrefix
|
|
162
|
+
|
|
163
|
+
`boolean` = `false`
|
|
138
164
|
|
|
139
165
|
Include the 0x prefix on the returned hex.
|
|
140
166
|
|
|
@@ -154,7 +180,9 @@ Convert the hex text to text.
|
|
|
154
180
|
|
|
155
181
|
#### Parameters
|
|
156
182
|
|
|
157
|
-
|
|
183
|
+
##### hex
|
|
184
|
+
|
|
185
|
+
`string`
|
|
158
186
|
|
|
159
187
|
The hex to convert.
|
|
160
188
|
|
|
@@ -174,7 +202,9 @@ Convert bytes to binary string.
|
|
|
174
202
|
|
|
175
203
|
#### Parameters
|
|
176
204
|
|
|
177
|
-
|
|
205
|
+
##### bytes
|
|
206
|
+
|
|
207
|
+
`Uint8Array`
|
|
178
208
|
|
|
179
209
|
The bytes to convert.
|
|
180
210
|
|
|
@@ -194,7 +224,9 @@ Convert a binary string to bytes.
|
|
|
194
224
|
|
|
195
225
|
#### Parameters
|
|
196
226
|
|
|
197
|
-
|
|
227
|
+
##### binary
|
|
228
|
+
|
|
229
|
+
`string`
|
|
198
230
|
|
|
199
231
|
The binary string.
|
|
200
232
|
|
|
@@ -214,7 +246,9 @@ Convert bytes to base64 string.
|
|
|
214
246
|
|
|
215
247
|
#### Parameters
|
|
216
248
|
|
|
217
|
-
|
|
249
|
+
##### bytes
|
|
250
|
+
|
|
251
|
+
`Uint8Array`
|
|
218
252
|
|
|
219
253
|
The bytes to convert.
|
|
220
254
|
|
|
@@ -234,7 +268,9 @@ Convert a base64 string to bytes.
|
|
|
234
268
|
|
|
235
269
|
#### Parameters
|
|
236
270
|
|
|
237
|
-
|
|
271
|
+
##### base64
|
|
272
|
+
|
|
273
|
+
`string`
|
|
238
274
|
|
|
239
275
|
The base64 string.
|
|
240
276
|
|
|
@@ -254,7 +290,9 @@ Convert bytes to base64 url string.
|
|
|
254
290
|
|
|
255
291
|
#### Parameters
|
|
256
292
|
|
|
257
|
-
|
|
293
|
+
##### bytes
|
|
294
|
+
|
|
295
|
+
`Uint8Array`
|
|
258
296
|
|
|
259
297
|
The bytes to convert.
|
|
260
298
|
|
|
@@ -274,7 +312,9 @@ Convert a base64 url string to bytes.
|
|
|
274
312
|
|
|
275
313
|
#### Parameters
|
|
276
314
|
|
|
277
|
-
|
|
315
|
+
##### base64Url
|
|
316
|
+
|
|
317
|
+
`string`
|
|
278
318
|
|
|
279
319
|
The base64 url string.
|
|
280
320
|
|
|
@@ -283,3 +323,47 @@ The base64 url string.
|
|
|
283
323
|
`Uint8Array`
|
|
284
324
|
|
|
285
325
|
The bytes.
|
|
326
|
+
|
|
327
|
+
***
|
|
328
|
+
|
|
329
|
+
### bytesToBase58()
|
|
330
|
+
|
|
331
|
+
> `static` **bytesToBase58**(`bytes`): `string`
|
|
332
|
+
|
|
333
|
+
Convert bytes to base58 string.
|
|
334
|
+
|
|
335
|
+
#### Parameters
|
|
336
|
+
|
|
337
|
+
##### bytes
|
|
338
|
+
|
|
339
|
+
`Uint8Array`
|
|
340
|
+
|
|
341
|
+
The bytes to convert.
|
|
342
|
+
|
|
343
|
+
#### Returns
|
|
344
|
+
|
|
345
|
+
`string`
|
|
346
|
+
|
|
347
|
+
A base58 string of the bytes.
|
|
348
|
+
|
|
349
|
+
***
|
|
350
|
+
|
|
351
|
+
### base58ToBytes()
|
|
352
|
+
|
|
353
|
+
> `static` **base58ToBytes**(`base58`): `Uint8Array`
|
|
354
|
+
|
|
355
|
+
Convert a base58 string to bytes.
|
|
356
|
+
|
|
357
|
+
#### Parameters
|
|
358
|
+
|
|
359
|
+
##### base58
|
|
360
|
+
|
|
361
|
+
`string`
|
|
362
|
+
|
|
363
|
+
The base58 string.
|
|
364
|
+
|
|
365
|
+
#### Returns
|
|
366
|
+
|
|
367
|
+
`Uint8Array`
|
|
368
|
+
|
|
369
|
+
The bytes.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Class: EnvHelper
|
|
2
|
+
|
|
3
|
+
Environment variable helper.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### new EnvHelper()
|
|
8
|
+
|
|
9
|
+
> **new EnvHelper**(): [`EnvHelper`](EnvHelper.md)
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
[`EnvHelper`](EnvHelper.md)
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### envToJson()
|
|
18
|
+
|
|
19
|
+
> `static` **envToJson**\<`T`\>(`envVars`, `prefix`?): `T`
|
|
20
|
+
|
|
21
|
+
Get the environment variable as an object with camel cased names.
|
|
22
|
+
|
|
23
|
+
#### Type Parameters
|
|
24
|
+
|
|
25
|
+
• **T** = \{\}
|
|
26
|
+
|
|
27
|
+
#### Parameters
|
|
28
|
+
|
|
29
|
+
##### envVars
|
|
30
|
+
|
|
31
|
+
The environment variables.
|
|
32
|
+
|
|
33
|
+
##### prefix?
|
|
34
|
+
|
|
35
|
+
`string`
|
|
36
|
+
|
|
37
|
+
The prefix of the environment variables, if not provided gets all.
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
`T`
|
|
42
|
+
|
|
43
|
+
The object with camel cased names.
|
|
@@ -22,7 +22,9 @@ Format Errors and returns just their messages.
|
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### error
|
|
26
|
+
|
|
27
|
+
`unknown`
|
|
26
28
|
|
|
27
29
|
The error to format.
|
|
28
30
|
|
|
@@ -42,7 +44,9 @@ Localize the content of an error and any inner errors.
|
|
|
42
44
|
|
|
43
45
|
#### Parameters
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
##### error
|
|
48
|
+
|
|
49
|
+
`unknown`
|
|
46
50
|
|
|
47
51
|
The error to format.
|
|
48
52
|
|
|
@@ -62,7 +66,9 @@ Localize the content of an error and any inner errors.
|
|
|
62
66
|
|
|
63
67
|
#### Parameters
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
##### error
|
|
70
|
+
|
|
71
|
+
[`IError`](../interfaces/IError.md)
|
|
66
72
|
|
|
67
73
|
The error to format.
|
|
68
74
|
|
|
@@ -20,15 +20,21 @@ Create a new factory, which is shared throughout all library instances.
|
|
|
20
20
|
|
|
21
21
|
#### Parameters
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
##### typeName
|
|
24
|
+
|
|
25
|
+
`string`
|
|
24
26
|
|
|
25
27
|
The type name for the instances.
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
##### autoInstance
|
|
30
|
+
|
|
31
|
+
`boolean` = `false`
|
|
28
32
|
|
|
29
33
|
Automatically create an instance when registered.
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
##### matcher?
|
|
36
|
+
|
|
37
|
+
(`names`, `name`) => `undefined` \| `string`
|
|
32
38
|
|
|
33
39
|
Match the name of the instance.
|
|
34
40
|
|
|
@@ -40,6 +46,44 @@ The factory instance.
|
|
|
40
46
|
|
|
41
47
|
***
|
|
42
48
|
|
|
49
|
+
### getFactories()
|
|
50
|
+
|
|
51
|
+
> `static` **getFactories**(): `object`
|
|
52
|
+
|
|
53
|
+
Get all the factories.
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`object`
|
|
58
|
+
|
|
59
|
+
All the factories.
|
|
60
|
+
|
|
61
|
+
***
|
|
62
|
+
|
|
63
|
+
### resetFactories()
|
|
64
|
+
|
|
65
|
+
> `static` **resetFactories**(): `void`
|
|
66
|
+
|
|
67
|
+
Reset all the factories, which removes any created instances, but not the registrations.
|
|
68
|
+
|
|
69
|
+
#### Returns
|
|
70
|
+
|
|
71
|
+
`void`
|
|
72
|
+
|
|
73
|
+
***
|
|
74
|
+
|
|
75
|
+
### clearFactories()
|
|
76
|
+
|
|
77
|
+
> `static` **clearFactories**(): `void`
|
|
78
|
+
|
|
79
|
+
Clear all the factories, which removes anything registered with the factories.
|
|
80
|
+
|
|
81
|
+
#### Returns
|
|
82
|
+
|
|
83
|
+
`void`
|
|
84
|
+
|
|
85
|
+
***
|
|
86
|
+
|
|
43
87
|
### register()
|
|
44
88
|
|
|
45
89
|
> **register**\<`U`\>(`name`, `generator`): `void`
|
|
@@ -52,11 +96,15 @@ Register a new generator.
|
|
|
52
96
|
|
|
53
97
|
#### Parameters
|
|
54
98
|
|
|
55
|
-
|
|
99
|
+
##### name
|
|
100
|
+
|
|
101
|
+
`string`
|
|
56
102
|
|
|
57
103
|
The name of the generator.
|
|
58
104
|
|
|
59
|
-
|
|
105
|
+
##### generator
|
|
106
|
+
|
|
107
|
+
() => `U`
|
|
60
108
|
|
|
61
109
|
The function to create an instance.
|
|
62
110
|
|
|
@@ -74,7 +122,9 @@ Unregister a generator.
|
|
|
74
122
|
|
|
75
123
|
#### Parameters
|
|
76
124
|
|
|
77
|
-
|
|
125
|
+
##### name
|
|
126
|
+
|
|
127
|
+
`string`
|
|
78
128
|
|
|
79
129
|
The name of the generator to unregister.
|
|
80
130
|
|
|
@@ -104,7 +154,9 @@ Get a generator instance.
|
|
|
104
154
|
|
|
105
155
|
#### Parameters
|
|
106
156
|
|
|
107
|
-
|
|
157
|
+
##### name
|
|
158
|
+
|
|
159
|
+
`string`
|
|
108
160
|
|
|
109
161
|
The name of the instance to generate.
|
|
110
162
|
|
|
@@ -136,7 +188,9 @@ Get a generator instance with no exceptions.
|
|
|
136
188
|
|
|
137
189
|
#### Parameters
|
|
138
190
|
|
|
139
|
-
|
|
191
|
+
##### name
|
|
192
|
+
|
|
193
|
+
`string`
|
|
140
194
|
|
|
141
195
|
The name of the instance to generate.
|
|
142
196
|
|
|
@@ -152,7 +206,19 @@ An instance of the item or undefined if it does not exist.
|
|
|
152
206
|
|
|
153
207
|
> **reset**(): `void`
|
|
154
208
|
|
|
155
|
-
|
|
209
|
+
Remove all the instances and leave the generators intact.
|
|
210
|
+
|
|
211
|
+
#### Returns
|
|
212
|
+
|
|
213
|
+
`void`
|
|
214
|
+
|
|
215
|
+
***
|
|
216
|
+
|
|
217
|
+
### clear()
|
|
218
|
+
|
|
219
|
+
> **clear**(): `void`
|
|
220
|
+
|
|
221
|
+
Remove all the instances and the generators.
|
|
156
222
|
|
|
157
223
|
#### Returns
|
|
158
224
|
|
|
@@ -210,7 +276,9 @@ Does the factory contain the name.
|
|
|
210
276
|
|
|
211
277
|
#### Parameters
|
|
212
278
|
|
|
213
|
-
|
|
279
|
+
##### name
|
|
280
|
+
|
|
281
|
+
`string`
|
|
214
282
|
|
|
215
283
|
The name of the instance to find.
|
|
216
284
|
|
|
@@ -16,19 +16,25 @@ Create a new instance of GeneralError.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### source
|
|
20
|
+
|
|
21
|
+
`string`
|
|
20
22
|
|
|
21
23
|
The source of the error.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
##### message
|
|
26
|
+
|
|
27
|
+
`string`
|
|
24
28
|
|
|
25
29
|
The message as a code.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
##### properties?
|
|
28
32
|
|
|
29
33
|
Any additional information for the error.
|
|
30
34
|
|
|
31
|
-
|
|
35
|
+
##### inner?
|
|
36
|
+
|
|
37
|
+
`unknown`
|
|
32
38
|
|
|
33
39
|
The inner error if we have wrapped another error.
|
|
34
40
|
|
|
@@ -50,7 +56,7 @@ The source of the error.
|
|
|
50
56
|
|
|
51
57
|
#### Inherited from
|
|
52
58
|
|
|
53
|
-
[`BaseError`](BaseError.md).[`source`](BaseError.md#source)
|
|
59
|
+
[`BaseError`](BaseError.md).[`source`](BaseError.md#source-1)
|
|
54
60
|
|
|
55
61
|
***
|
|
56
62
|
|
|
@@ -62,11 +68,11 @@ Any additional information for the error.
|
|
|
62
68
|
|
|
63
69
|
#### Index Signature
|
|
64
70
|
|
|
65
|
-
|
|
71
|
+
\[`id`: `string`\]: `unknown`
|
|
66
72
|
|
|
67
73
|
#### Inherited from
|
|
68
74
|
|
|
69
|
-
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
|
|
75
|
+
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties-1)
|
|
70
76
|
|
|
71
77
|
***
|
|
72
78
|
|
|
@@ -78,7 +84,7 @@ The inner error if there was one.
|
|
|
78
84
|
|
|
79
85
|
#### Inherited from
|
|
80
86
|
|
|
81
|
-
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
|
|
87
|
+
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner-1)
|
|
82
88
|
|
|
83
89
|
***
|
|
84
90
|
|
|
@@ -98,7 +104,9 @@ Construct an error from an existing one.
|
|
|
98
104
|
|
|
99
105
|
#### Parameters
|
|
100
106
|
|
|
101
|
-
|
|
107
|
+
##### err
|
|
108
|
+
|
|
109
|
+
`unknown`
|
|
102
110
|
|
|
103
111
|
The existing error.
|
|
104
112
|
|
|
@@ -122,7 +130,9 @@ Flatten an error tree.
|
|
|
122
130
|
|
|
123
131
|
#### Parameters
|
|
124
132
|
|
|
125
|
-
|
|
133
|
+
##### err
|
|
134
|
+
|
|
135
|
+
`unknown`
|
|
126
136
|
|
|
127
137
|
The starting error.
|
|
128
138
|
|
|
@@ -146,10 +156,12 @@ Expand an error tree.
|
|
|
146
156
|
|
|
147
157
|
#### Parameters
|
|
148
158
|
|
|
149
|
-
|
|
159
|
+
##### errors
|
|
150
160
|
|
|
151
161
|
The list of errors to expand.
|
|
152
162
|
|
|
163
|
+
`undefined` | [`IError`](../interfaces/IError.md)[]
|
|
164
|
+
|
|
153
165
|
#### Returns
|
|
154
166
|
|
|
155
167
|
`undefined` \| [`IError`](../interfaces/IError.md)
|
|
@@ -170,14 +182,18 @@ Test to see if the error has the specified error name.
|
|
|
170
182
|
|
|
171
183
|
#### Parameters
|
|
172
184
|
|
|
173
|
-
|
|
185
|
+
##### error
|
|
186
|
+
|
|
187
|
+
`unknown`
|
|
174
188
|
|
|
175
189
|
The error to test.
|
|
176
190
|
|
|
177
|
-
|
|
191
|
+
##### name
|
|
178
192
|
|
|
179
193
|
The name to check for.
|
|
180
194
|
|
|
195
|
+
`string` | `RegExp`
|
|
196
|
+
|
|
181
197
|
#### Returns
|
|
182
198
|
|
|
183
199
|
`error is BaseError`
|
|
@@ -198,14 +214,18 @@ Test to see if the error has the specified error message.
|
|
|
198
214
|
|
|
199
215
|
#### Parameters
|
|
200
216
|
|
|
201
|
-
|
|
217
|
+
##### error
|
|
218
|
+
|
|
219
|
+
`unknown`
|
|
202
220
|
|
|
203
221
|
The error to test.
|
|
204
222
|
|
|
205
|
-
|
|
223
|
+
##### message
|
|
206
224
|
|
|
207
225
|
The message to check for.
|
|
208
226
|
|
|
227
|
+
`string` | `RegExp`
|
|
228
|
+
|
|
209
229
|
#### Returns
|
|
210
230
|
|
|
211
231
|
`error is BaseError`
|
|
@@ -226,14 +246,18 @@ Test to see if the error has the specified error code.
|
|
|
226
246
|
|
|
227
247
|
#### Parameters
|
|
228
248
|
|
|
229
|
-
|
|
249
|
+
##### error
|
|
250
|
+
|
|
251
|
+
`unknown`
|
|
230
252
|
|
|
231
253
|
The error to test.
|
|
232
254
|
|
|
233
|
-
|
|
255
|
+
##### code
|
|
234
256
|
|
|
235
257
|
The code to check for.
|
|
236
258
|
|
|
259
|
+
`string` | `RegExp`
|
|
260
|
+
|
|
237
261
|
#### Returns
|
|
238
262
|
|
|
239
263
|
`boolean`
|
|
@@ -254,14 +278,18 @@ Test to see if any of the errors or children have the given error name.
|
|
|
254
278
|
|
|
255
279
|
#### Parameters
|
|
256
280
|
|
|
257
|
-
|
|
281
|
+
##### error
|
|
282
|
+
|
|
283
|
+
`unknown`
|
|
258
284
|
|
|
259
285
|
The error to test.
|
|
260
286
|
|
|
261
|
-
|
|
287
|
+
##### name
|
|
262
288
|
|
|
263
289
|
The name to check for.
|
|
264
290
|
|
|
291
|
+
`string` | `RegExp`
|
|
292
|
+
|
|
265
293
|
#### Returns
|
|
266
294
|
|
|
267
295
|
`error is BaseError`
|
|
@@ -282,14 +310,18 @@ Test to see if any of the errors or children have the given error message.
|
|
|
282
310
|
|
|
283
311
|
#### Parameters
|
|
284
312
|
|
|
285
|
-
|
|
313
|
+
##### error
|
|
314
|
+
|
|
315
|
+
`unknown`
|
|
286
316
|
|
|
287
317
|
The error to test.
|
|
288
318
|
|
|
289
|
-
|
|
319
|
+
##### message
|
|
290
320
|
|
|
291
321
|
The message to check for.
|
|
292
322
|
|
|
323
|
+
`string` | `RegExp`
|
|
324
|
+
|
|
293
325
|
#### Returns
|
|
294
326
|
|
|
295
327
|
`error is BaseError`
|
|
@@ -310,11 +342,15 @@ Test to see if any of the errors or children are from a specific class.
|
|
|
310
342
|
|
|
311
343
|
#### Parameters
|
|
312
344
|
|
|
313
|
-
|
|
345
|
+
##### error
|
|
346
|
+
|
|
347
|
+
`unknown`
|
|
314
348
|
|
|
315
349
|
The error to test.
|
|
316
350
|
|
|
317
|
-
|
|
351
|
+
##### cls
|
|
352
|
+
|
|
353
|
+
`string`
|
|
318
354
|
|
|
319
355
|
The class to check for.
|
|
320
356
|
|
|
@@ -338,14 +374,18 @@ Test to see if any of the errors or children have the given error code.
|
|
|
338
374
|
|
|
339
375
|
#### Parameters
|
|
340
376
|
|
|
341
|
-
|
|
377
|
+
##### error
|
|
378
|
+
|
|
379
|
+
`unknown`
|
|
342
380
|
|
|
343
381
|
The error to test.
|
|
344
382
|
|
|
345
|
-
|
|
383
|
+
##### code
|
|
346
384
|
|
|
347
385
|
The code to check for.
|
|
348
386
|
|
|
387
|
+
`string` | `RegExp`
|
|
388
|
+
|
|
349
389
|
#### Returns
|
|
350
390
|
|
|
351
391
|
`error is BaseError`
|