@twin.org/core 0.0.2-next.9 → 0.0.2
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 +75 -0
- package/dist/es/encoding/base32.js.map +1 -0
- package/dist/es/encoding/base58.js +124 -0
- package/dist/es/encoding/base58.js.map +1 -0
- package/dist/es/encoding/base64.js +231 -0
- package/dist/es/encoding/base64.js.map +1 -0
- package/dist/es/encoding/base64Url.js +42 -0
- package/dist/es/encoding/base64Url.js.map +1 -0
- package/dist/es/errors/alreadyExistsError.js +22 -0
- package/dist/es/errors/alreadyExistsError.js.map +1 -0
- package/dist/es/errors/baseError.js +257 -0
- package/dist/es/errors/baseError.js.map +1 -0
- package/dist/es/errors/conflictError.js +23 -0
- package/dist/es/errors/conflictError.js.map +1 -0
- package/dist/es/errors/generalError.js +21 -0
- package/dist/es/errors/generalError.js.map +1 -0
- package/dist/es/errors/guardError.js +27 -0
- package/dist/es/errors/guardError.js.map +1 -0
- package/dist/es/errors/notFoundError.js +22 -0
- package/dist/es/errors/notFoundError.js.map +1 -0
- package/dist/es/errors/notImplementedError.js +24 -0
- package/dist/es/errors/notImplementedError.js.map +1 -0
- package/dist/es/errors/notSupportedError.js +21 -0
- package/dist/es/errors/notSupportedError.js.map +1 -0
- package/dist/es/errors/unauthorizedError.js +21 -0
- package/dist/es/errors/unauthorizedError.js.map +1 -0
- package/dist/es/errors/unprocessableError.js +21 -0
- package/dist/es/errors/unprocessableError.js.map +1 -0
- package/dist/es/errors/validationError.js +23 -0
- package/dist/es/errors/validationError.js.map +1 -0
- package/dist/es/factories/componentFactory.js +9 -0
- package/dist/es/factories/componentFactory.js.map +1 -0
- package/dist/es/factories/factory.js +297 -0
- package/dist/es/factories/factory.js.map +1 -0
- package/dist/es/helpers/arrayHelper.js +46 -0
- package/dist/es/helpers/arrayHelper.js.map +1 -0
- package/dist/es/helpers/envHelper.js +39 -0
- package/dist/es/helpers/envHelper.js.map +1 -0
- package/dist/es/helpers/errorHelper.js +100 -0
- package/dist/es/helpers/errorHelper.js.map +1 -0
- package/dist/es/helpers/filenameHelper.js +32 -0
- package/dist/es/helpers/filenameHelper.js.map +1 -0
- package/dist/es/helpers/hexHelper.js +45 -0
- package/dist/es/helpers/hexHelper.js.map +1 -0
- package/dist/es/helpers/jsonHelper.js +163 -0
- package/dist/es/helpers/jsonHelper.js.map +1 -0
- package/dist/es/helpers/numberHelper.js +30 -0
- package/dist/es/helpers/numberHelper.js.map +1 -0
- package/dist/es/helpers/objectHelper.js +309 -0
- package/dist/es/helpers/objectHelper.js.map +1 -0
- package/dist/es/helpers/randomHelper.js +66 -0
- package/dist/es/helpers/randomHelper.js.map +1 -0
- package/dist/es/helpers/stringHelper.js +252 -0
- package/dist/es/helpers/stringHelper.js.map +1 -0
- package/dist/es/helpers/uint8ArrayHelper.js +26 -0
- package/dist/es/helpers/uint8ArrayHelper.js.map +1 -0
- package/dist/es/index.js +60 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IComponent.js +2 -0
- package/dist/es/models/IComponent.js.map +1 -0
- package/dist/es/models/IError.js +4 -0
- package/dist/es/models/IError.js.map +1 -0
- package/dist/es/models/IHealth.js +2 -0
- package/dist/es/models/IHealth.js.map +1 -0
- package/dist/es/models/II18nShared.js +2 -0
- package/dist/es/models/II18nShared.js.map +1 -0
- package/dist/es/models/IKeyValue.js +2 -0
- package/dist/es/models/IKeyValue.js.map +1 -0
- package/dist/es/models/ILabelledValue.js +2 -0
- package/dist/es/models/ILabelledValue.js.map +1 -0
- package/dist/es/models/ILocale.js +2 -0
- package/dist/es/models/ILocale.js.map +1 -0
- package/dist/es/models/ILocaleDictionary.js +4 -0
- package/dist/es/models/ILocaleDictionary.js.map +1 -0
- package/dist/es/models/ILocalesIndex.js +2 -0
- package/dist/es/models/ILocalesIndex.js.map +1 -0
- package/dist/es/models/IPatchOperation.js +4 -0
- package/dist/es/models/IPatchOperation.js.map +1 -0
- package/dist/es/models/IUrlParts.js +4 -0
- package/dist/es/models/IUrlParts.js.map +1 -0
- package/dist/es/models/IValidationFailure.js +2 -0
- package/dist/es/models/IValidationFailure.js.map +1 -0
- package/dist/es/models/coerceType.js +49 -0
- package/dist/es/models/coerceType.js.map +1 -0
- package/dist/es/models/compressionType.js +17 -0
- package/dist/es/models/compressionType.js.map +1 -0
- package/dist/es/models/healthStatus.js +21 -0
- package/dist/es/models/healthStatus.js.map +1 -0
- package/dist/es/types/bitString.js +98 -0
- package/dist/es/types/bitString.js.map +1 -0
- package/dist/es/types/objectOrArray.js +2 -0
- 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/url.js +144 -0
- package/dist/es/types/url.js.map +1 -0
- package/dist/es/types/urn.js +211 -0
- package/dist/es/types/urn.js.map +1 -0
- package/dist/es/utils/asyncCache.js +206 -0
- package/dist/es/utils/asyncCache.js.map +1 -0
- package/dist/es/utils/coerce.js +269 -0
- package/dist/es/utils/coerce.js.map +1 -0
- package/dist/es/utils/compression.js +49 -0
- package/dist/es/utils/compression.js.map +1 -0
- package/dist/es/utils/converter.js +256 -0
- package/dist/es/utils/converter.js.map +1 -0
- package/dist/es/utils/guards.js +385 -0
- package/dist/es/utils/guards.js.map +1 -0
- package/dist/es/utils/i18n.js +243 -0
- package/dist/es/utils/i18n.js.map +1 -0
- package/dist/es/utils/is.js +367 -0
- package/dist/es/utils/is.js.map +1 -0
- package/dist/es/utils/sharedStore.js +48 -0
- package/dist/es/utils/sharedStore.js.map +1 -0
- package/dist/es/utils/validation.js +774 -0
- package/dist/es/utils/validation.js.map +1 -0
- package/dist/types/encoding/base32.d.ts +5 -1
- package/dist/types/encoding/base58.d.ts +4 -0
- package/dist/types/encoding/base64.d.ts +4 -0
- package/dist/types/encoding/base64Url.d.ts +4 -0
- package/dist/types/errors/alreadyExistsError.d.ts +6 -3
- package/dist/types/errors/baseError.d.ts +2 -2
- package/dist/types/errors/conflictError.d.ts +6 -3
- package/dist/types/errors/generalError.d.ts +2 -2
- package/dist/types/errors/guardError.d.ts +2 -2
- package/dist/types/errors/notFoundError.d.ts +6 -3
- package/dist/types/errors/notImplementedError.d.ts +6 -2
- package/dist/types/errors/notSupportedError.d.ts +6 -3
- package/dist/types/errors/unauthorizedError.d.ts +7 -4
- package/dist/types/errors/unprocessableError.d.ts +2 -2
- package/dist/types/errors/validationError.d.ts +2 -2
- package/dist/types/factories/componentFactory.d.ts +2 -2
- package/dist/types/factories/factory.d.ts +27 -1
- package/dist/types/helpers/arrayHelper.d.ts +1 -8
- package/dist/types/helpers/errorHelper.d.ts +1 -1
- package/dist/types/helpers/jsonHelper.d.ts +5 -1
- package/dist/types/helpers/numberHelper.d.ts +17 -0
- package/dist/types/helpers/objectHelper.d.ts +24 -6
- package/dist/types/helpers/randomHelper.d.ts +16 -0
- package/dist/types/helpers/stringHelper.d.ts +12 -6
- package/dist/types/index.d.ts +57 -53
- package/dist/types/models/IComponent.d.ts +18 -7
- package/dist/types/models/IError.d.ts +1 -1
- package/dist/types/models/IHealth.d.ts +32 -0
- package/dist/types/models/ILocalesIndex.d.ts +1 -1
- package/dist/types/models/IValidationFailure.d.ts +0 -4
- package/dist/types/models/healthStatus.d.ts +21 -0
- package/dist/types/types/bitString.d.ts +4 -0
- package/dist/types/types/singleOccurrenceArray.d.ts +9 -0
- package/dist/types/types/url.d.ts +8 -3
- package/dist/types/types/urn.d.ts +7 -2
- package/dist/types/utils/asyncCache.d.ts +7 -0
- package/dist/types/utils/coerce.d.ts +1 -1
- package/dist/types/utils/compression.d.ts +5 -1
- package/dist/types/utils/guards.d.ts +11 -3
- package/dist/types/utils/i18n.d.ts +16 -1
- package/dist/types/utils/is.d.ts +8 -1
- package/dist/types/utils/validation.d.ts +1 -1
- package/docs/changelog.md +1224 -131
- package/docs/examples.md +308 -1
- package/docs/reference/classes/AlreadyExistsError.md +43 -39
- package/docs/reference/classes/ArrayHelper.md +10 -44
- package/docs/reference/classes/AsyncCache.md +12 -12
- package/docs/reference/classes/Base32.md +11 -3
- package/docs/reference/classes/Base58.md +10 -2
- package/docs/reference/classes/Base64.md +11 -3
- package/docs/reference/classes/Base64Url.md +10 -2
- package/docs/reference/classes/BaseError.md +37 -37
- package/docs/reference/classes/BitString.md +13 -5
- package/docs/reference/classes/Coerce.md +31 -31
- package/docs/reference/classes/Compression.md +10 -2
- package/docs/reference/classes/ConflictError.md +43 -39
- package/docs/reference/classes/Converter.md +18 -18
- package/docs/reference/classes/EnvHelper.md +1 -1
- package/docs/reference/classes/ErrorHelper.md +5 -5
- package/docs/reference/classes/Factory.md +122 -20
- package/docs/reference/classes/FilenameHelper.md +1 -1
- package/docs/reference/classes/GeneralError.md +38 -38
- package/docs/reference/classes/GuardError.md +38 -38
- package/docs/reference/classes/Guards.md +80 -34
- package/docs/reference/classes/HexHelper.md +6 -6
- package/docs/reference/classes/I18n.md +66 -14
- package/docs/reference/classes/Is.md +77 -43
- package/docs/reference/classes/JsonHelper.md +17 -9
- package/docs/reference/classes/NotFoundError.md +43 -39
- package/docs/reference/classes/NotImplementedError.md +48 -38
- package/docs/reference/classes/NotSupportedError.md +43 -39
- package/docs/reference/classes/NumberHelper.md +55 -0
- package/docs/reference/classes/ObjectHelper.md +163 -51
- package/docs/reference/classes/RandomHelper.md +53 -1
- package/docs/reference/classes/SharedStore.md +5 -5
- package/docs/reference/classes/StringHelper.md +52 -30
- package/docs/reference/classes/Uint8ArrayHelper.md +1 -1
- package/docs/reference/classes/UnauthorizedError.md +44 -40
- package/docs/reference/classes/UnprocessableError.md +38 -38
- package/docs/reference/classes/Url.md +24 -10
- package/docs/reference/classes/Urn.md +42 -28
- package/docs/reference/classes/Validation.md +27 -27
- package/docs/reference/classes/ValidationError.md +37 -37
- package/docs/reference/index.md +6 -0
- package/docs/reference/interfaces/IComponent.md +57 -27
- package/docs/reference/interfaces/IError.md +11 -11
- package/docs/reference/interfaces/IHealth.md +55 -0
- 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 -12
- package/docs/reference/type-aliases/HealthStatus.md +5 -0
- 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/docs/reference/variables/HealthStatus.md +25 -0
- package/locales/.validate-ignore +1 -0
- package/locales/en.json +9 -7
- package/package.json +24 -12
- package/dist/cjs/index.cjs +0 -5175
- package/dist/esm/index.mjs +0 -5133
- /package/dist/types/{models → types}/objectOrArray.d.ts +0 -0
|
@@ -8,11 +8,19 @@ Factory for creating implementation of generic types.
|
|
|
8
8
|
|
|
9
9
|
`T`
|
|
10
10
|
|
|
11
|
+
## Properties
|
|
12
|
+
|
|
13
|
+
### CLASS\_NAME {#class_name}
|
|
14
|
+
|
|
15
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
16
|
+
|
|
17
|
+
Runtime name for the class.
|
|
18
|
+
|
|
11
19
|
## Methods
|
|
12
20
|
|
|
13
|
-
### createFactory()
|
|
21
|
+
### createFactory() {#createfactory}
|
|
14
22
|
|
|
15
|
-
> `static` **createFactory**\<`U`\>(`typeName`, `autoInstance
|
|
23
|
+
> `static` **createFactory**\<`U`\>(`typeName`, `autoInstance?`, `matcher?`): `Factory`\<`U`\>
|
|
16
24
|
|
|
17
25
|
Create a new factory, which is shared throughout all library instances.
|
|
18
26
|
|
|
@@ -30,7 +38,7 @@ Create a new factory, which is shared throughout all library instances.
|
|
|
30
38
|
|
|
31
39
|
The type name for the instances.
|
|
32
40
|
|
|
33
|
-
##### autoInstance
|
|
41
|
+
##### autoInstance?
|
|
34
42
|
|
|
35
43
|
`boolean` = `false`
|
|
36
44
|
|
|
@@ -38,7 +46,7 @@ Automatically create an instance when registered.
|
|
|
38
46
|
|
|
39
47
|
##### matcher?
|
|
40
48
|
|
|
41
|
-
(`names`, `name`) => `
|
|
49
|
+
(`names`, `name`) => `string` \| `undefined`
|
|
42
50
|
|
|
43
51
|
Match the name of the instance.
|
|
44
52
|
|
|
@@ -50,7 +58,7 @@ The factory instance.
|
|
|
50
58
|
|
|
51
59
|
***
|
|
52
60
|
|
|
53
|
-
### getFactories()
|
|
61
|
+
### getFactories() {#getfactories}
|
|
54
62
|
|
|
55
63
|
> `static` **getFactories**(): `object`
|
|
56
64
|
|
|
@@ -64,7 +72,7 @@ All the factories.
|
|
|
64
72
|
|
|
65
73
|
***
|
|
66
74
|
|
|
67
|
-
### resetFactories()
|
|
75
|
+
### resetFactories() {#resetfactories}
|
|
68
76
|
|
|
69
77
|
> `static` **resetFactories**(): `void`
|
|
70
78
|
|
|
@@ -76,7 +84,7 @@ Reset all the factories, which removes any created instances, but not the regist
|
|
|
76
84
|
|
|
77
85
|
***
|
|
78
86
|
|
|
79
|
-
### clearFactories()
|
|
87
|
+
### clearFactories() {#clearfactories}
|
|
80
88
|
|
|
81
89
|
> `static` **clearFactories**(): `void`
|
|
82
90
|
|
|
@@ -88,7 +96,21 @@ Clear all the factories, which removes anything registered with the factories.
|
|
|
88
96
|
|
|
89
97
|
***
|
|
90
98
|
|
|
91
|
-
###
|
|
99
|
+
### typeName() {#typename}
|
|
100
|
+
|
|
101
|
+
> **typeName**(): `string`
|
|
102
|
+
|
|
103
|
+
Get the type name of the factory.
|
|
104
|
+
|
|
105
|
+
#### Returns
|
|
106
|
+
|
|
107
|
+
`string`
|
|
108
|
+
|
|
109
|
+
The type name of the factory.
|
|
110
|
+
|
|
111
|
+
***
|
|
112
|
+
|
|
113
|
+
### register() {#register}
|
|
92
114
|
|
|
93
115
|
> **register**\<`U`\>(`name`, `generator`): `void`
|
|
94
116
|
|
|
@@ -110,7 +132,7 @@ The name of the generator.
|
|
|
110
132
|
|
|
111
133
|
##### generator
|
|
112
134
|
|
|
113
|
-
() => `U`
|
|
135
|
+
(`args?`) => `U`
|
|
114
136
|
|
|
115
137
|
The function to create an instance.
|
|
116
138
|
|
|
@@ -120,7 +142,7 @@ The function to create an instance.
|
|
|
120
142
|
|
|
121
143
|
***
|
|
122
144
|
|
|
123
|
-
### unregister()
|
|
145
|
+
### unregister() {#unregister}
|
|
124
146
|
|
|
125
147
|
> **unregister**(`name`): `void`
|
|
126
148
|
|
|
@@ -148,7 +170,7 @@ GeneralError if no generator exists.
|
|
|
148
170
|
|
|
149
171
|
***
|
|
150
172
|
|
|
151
|
-
### get()
|
|
173
|
+
### get() {#get}
|
|
152
174
|
|
|
153
175
|
> **get**\<`U`\>(`name`): `U`
|
|
154
176
|
|
|
@@ -184,9 +206,9 @@ GeneralError if no item exists to get.
|
|
|
184
206
|
|
|
185
207
|
***
|
|
186
208
|
|
|
187
|
-
### getIfExists()
|
|
209
|
+
### getIfExists() {#getifexists}
|
|
188
210
|
|
|
189
|
-
> **getIfExists**\<`U`\>(`name?`): `
|
|
211
|
+
> **getIfExists**\<`U`\>(`name?`): `U` \| `undefined`
|
|
190
212
|
|
|
191
213
|
Get a generator instance with no exceptions.
|
|
192
214
|
|
|
@@ -206,13 +228,93 @@ The name of the instance to generate.
|
|
|
206
228
|
|
|
207
229
|
#### Returns
|
|
208
230
|
|
|
209
|
-
`
|
|
231
|
+
`U` \| `undefined`
|
|
210
232
|
|
|
211
233
|
An instance of the item or undefined if it does not exist.
|
|
212
234
|
|
|
213
235
|
***
|
|
214
236
|
|
|
215
|
-
###
|
|
237
|
+
### create() {#create}
|
|
238
|
+
|
|
239
|
+
> **create**\<`U`\>(`name`, `args?`): `U`
|
|
240
|
+
|
|
241
|
+
Create a new instance without caching it.
|
|
242
|
+
|
|
243
|
+
#### Type Parameters
|
|
244
|
+
|
|
245
|
+
##### U
|
|
246
|
+
|
|
247
|
+
`U`
|
|
248
|
+
|
|
249
|
+
#### Parameters
|
|
250
|
+
|
|
251
|
+
##### name
|
|
252
|
+
|
|
253
|
+
`string`
|
|
254
|
+
|
|
255
|
+
The name of the instance to generate.
|
|
256
|
+
|
|
257
|
+
##### args?
|
|
258
|
+
|
|
259
|
+
`unknown`
|
|
260
|
+
|
|
261
|
+
The arguments to pass to the generator.
|
|
262
|
+
|
|
263
|
+
#### Returns
|
|
264
|
+
|
|
265
|
+
`U`
|
|
266
|
+
|
|
267
|
+
A new instance of the item.
|
|
268
|
+
|
|
269
|
+
#### Throws
|
|
270
|
+
|
|
271
|
+
GuardError if the parameters are invalid.
|
|
272
|
+
|
|
273
|
+
#### Throws
|
|
274
|
+
|
|
275
|
+
GeneralError if no item exists to create.
|
|
276
|
+
|
|
277
|
+
***
|
|
278
|
+
|
|
279
|
+
### createIfExists() {#createifexists}
|
|
280
|
+
|
|
281
|
+
> **createIfExists**\<`U`\>(`name`, `args?`): `U` \| `undefined`
|
|
282
|
+
|
|
283
|
+
Create a new instance without caching it if it exists.
|
|
284
|
+
|
|
285
|
+
#### Type Parameters
|
|
286
|
+
|
|
287
|
+
##### U
|
|
288
|
+
|
|
289
|
+
`U`
|
|
290
|
+
|
|
291
|
+
#### Parameters
|
|
292
|
+
|
|
293
|
+
##### name
|
|
294
|
+
|
|
295
|
+
`string`
|
|
296
|
+
|
|
297
|
+
The name of the instance to generate.
|
|
298
|
+
|
|
299
|
+
##### args?
|
|
300
|
+
|
|
301
|
+
`unknown`
|
|
302
|
+
|
|
303
|
+
The arguments to pass to the generator.
|
|
304
|
+
|
|
305
|
+
#### Returns
|
|
306
|
+
|
|
307
|
+
`U` \| `undefined`
|
|
308
|
+
|
|
309
|
+
A new instance of the item if it exists.
|
|
310
|
+
|
|
311
|
+
#### Throws
|
|
312
|
+
|
|
313
|
+
GuardError if the parameters are invalid.
|
|
314
|
+
|
|
315
|
+
***
|
|
316
|
+
|
|
317
|
+
### reset() {#reset}
|
|
216
318
|
|
|
217
319
|
> **reset**(): `void`
|
|
218
320
|
|
|
@@ -224,7 +326,7 @@ Remove all the instances and leave the generators intact.
|
|
|
224
326
|
|
|
225
327
|
***
|
|
226
328
|
|
|
227
|
-
### clear()
|
|
329
|
+
### clear() {#clear}
|
|
228
330
|
|
|
229
331
|
> **clear**(): `void`
|
|
230
332
|
|
|
@@ -236,7 +338,7 @@ Remove all the instances and the generators.
|
|
|
236
338
|
|
|
237
339
|
***
|
|
238
340
|
|
|
239
|
-
### instancesMap()
|
|
341
|
+
### instancesMap() {#instancesmap}
|
|
240
342
|
|
|
241
343
|
> **instancesMap**(): `object`
|
|
242
344
|
|
|
@@ -250,7 +352,7 @@ The instances as a map.
|
|
|
250
352
|
|
|
251
353
|
***
|
|
252
354
|
|
|
253
|
-
### instancesList()
|
|
355
|
+
### instancesList() {#instanceslist}
|
|
254
356
|
|
|
255
357
|
> **instancesList**(): `T`[]
|
|
256
358
|
|
|
@@ -264,7 +366,7 @@ The instances as a list in the order they were registered.
|
|
|
264
366
|
|
|
265
367
|
***
|
|
266
368
|
|
|
267
|
-
### names()
|
|
369
|
+
### names() {#names}
|
|
268
370
|
|
|
269
371
|
> **names**(): `string`[]
|
|
270
372
|
|
|
@@ -278,7 +380,7 @@ The ordered generator names.
|
|
|
278
380
|
|
|
279
381
|
***
|
|
280
382
|
|
|
281
|
-
### hasName()
|
|
383
|
+
### hasName() {#hasname}
|
|
282
384
|
|
|
283
385
|
> **hasName**(`name`): `boolean`
|
|
284
386
|
|
|
@@ -26,7 +26,7 @@ The source of the error.
|
|
|
26
26
|
|
|
27
27
|
`string`
|
|
28
28
|
|
|
29
|
-
The message as
|
|
29
|
+
The message as an i18n key.
|
|
30
30
|
|
|
31
31
|
##### properties?
|
|
32
32
|
|
|
@@ -48,9 +48,9 @@ The cause of the error if we have wrapped another error.
|
|
|
48
48
|
|
|
49
49
|
## Properties
|
|
50
50
|
|
|
51
|
-
### source?
|
|
51
|
+
### source? {#source}
|
|
52
52
|
|
|
53
|
-
> `optional` **source
|
|
53
|
+
> `optional` **source?**: `string`
|
|
54
54
|
|
|
55
55
|
The source of the error.
|
|
56
56
|
|
|
@@ -60,9 +60,9 @@ The source of the error.
|
|
|
60
60
|
|
|
61
61
|
***
|
|
62
62
|
|
|
63
|
-
### properties?
|
|
63
|
+
### properties? {#properties}
|
|
64
64
|
|
|
65
|
-
> `optional` **properties
|
|
65
|
+
> `optional` **properties?**: `object`
|
|
66
66
|
|
|
67
67
|
Any additional information for the error.
|
|
68
68
|
|
|
@@ -76,9 +76,9 @@ Any additional information for the error.
|
|
|
76
76
|
|
|
77
77
|
***
|
|
78
78
|
|
|
79
|
-
### cause?
|
|
79
|
+
### cause? {#cause}
|
|
80
80
|
|
|
81
|
-
> `optional` **cause
|
|
81
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
82
82
|
|
|
83
83
|
The cause of the error.
|
|
84
84
|
|
|
@@ -88,7 +88,7 @@ The cause of the error.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### CLASS\_NAME
|
|
91
|
+
### CLASS\_NAME {#class_name}
|
|
92
92
|
|
|
93
93
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
94
94
|
|
|
@@ -96,7 +96,7 @@ Runtime name for the class.
|
|
|
96
96
|
|
|
97
97
|
## Methods
|
|
98
98
|
|
|
99
|
-
### fromError()
|
|
99
|
+
### fromError() {#fromerror}
|
|
100
100
|
|
|
101
101
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
102
102
|
|
|
@@ -122,7 +122,7 @@ The new instance.
|
|
|
122
122
|
|
|
123
123
|
***
|
|
124
124
|
|
|
125
|
-
### flatten()
|
|
125
|
+
### flatten() {#flatten}
|
|
126
126
|
|
|
127
127
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
128
128
|
|
|
@@ -148,9 +148,9 @@ The list of all internal errors.
|
|
|
148
148
|
|
|
149
149
|
***
|
|
150
150
|
|
|
151
|
-
### expand()
|
|
151
|
+
### expand() {#expand}
|
|
152
152
|
|
|
153
|
-
> `static` **expand**(`errors`):
|
|
153
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
154
154
|
|
|
155
155
|
Expand an error tree.
|
|
156
156
|
|
|
@@ -158,13 +158,13 @@ Expand an error tree.
|
|
|
158
158
|
|
|
159
159
|
##### errors
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
The list of errors to expand.
|
|
164
164
|
|
|
165
165
|
#### Returns
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
168
168
|
|
|
169
169
|
The first level error.
|
|
170
170
|
|
|
@@ -174,7 +174,7 @@ The first level error.
|
|
|
174
174
|
|
|
175
175
|
***
|
|
176
176
|
|
|
177
|
-
### isErrorName()
|
|
177
|
+
### isErrorName() {#iserrorname}
|
|
178
178
|
|
|
179
179
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
180
180
|
|
|
@@ -190,9 +190,9 @@ The error to test.
|
|
|
190
190
|
|
|
191
191
|
##### name
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
`string` \| `RegExp`
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
The name to check for.
|
|
196
196
|
|
|
197
197
|
#### Returns
|
|
198
198
|
|
|
@@ -206,7 +206,7 @@ True if the error has the name.
|
|
|
206
206
|
|
|
207
207
|
***
|
|
208
208
|
|
|
209
|
-
### isErrorMessage()
|
|
209
|
+
### isErrorMessage() {#iserrormessage}
|
|
210
210
|
|
|
211
211
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
212
212
|
|
|
@@ -222,9 +222,9 @@ The error to test.
|
|
|
222
222
|
|
|
223
223
|
##### message
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
`string` \| `RegExp`
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
The message to check for.
|
|
228
228
|
|
|
229
229
|
#### Returns
|
|
230
230
|
|
|
@@ -238,7 +238,7 @@ True if the error has the name.
|
|
|
238
238
|
|
|
239
239
|
***
|
|
240
240
|
|
|
241
|
-
### isErrorCode()
|
|
241
|
+
### isErrorCode() {#iserrorcode}
|
|
242
242
|
|
|
243
243
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
244
244
|
|
|
@@ -254,9 +254,9 @@ The error to test.
|
|
|
254
254
|
|
|
255
255
|
##### code
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
`string` \| `RegExp`
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
The code to check for.
|
|
260
260
|
|
|
261
261
|
#### Returns
|
|
262
262
|
|
|
@@ -270,7 +270,7 @@ True if the error has the code.
|
|
|
270
270
|
|
|
271
271
|
***
|
|
272
272
|
|
|
273
|
-
### someErrorName()
|
|
273
|
+
### someErrorName() {#someerrorname}
|
|
274
274
|
|
|
275
275
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
276
276
|
|
|
@@ -286,9 +286,9 @@ The error to test.
|
|
|
286
286
|
|
|
287
287
|
##### name
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
`string` \| `RegExp`
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
The name to check for.
|
|
292
292
|
|
|
293
293
|
#### Returns
|
|
294
294
|
|
|
@@ -302,7 +302,7 @@ True if the error has the name.
|
|
|
302
302
|
|
|
303
303
|
***
|
|
304
304
|
|
|
305
|
-
### someErrorMessage()
|
|
305
|
+
### someErrorMessage() {#someerrormessage}
|
|
306
306
|
|
|
307
307
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
308
308
|
|
|
@@ -318,9 +318,9 @@ The error to test.
|
|
|
318
318
|
|
|
319
319
|
##### message
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
`string` \| `RegExp`
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
The message to check for.
|
|
324
324
|
|
|
325
325
|
#### Returns
|
|
326
326
|
|
|
@@ -334,7 +334,7 @@ True if the error has the name.
|
|
|
334
334
|
|
|
335
335
|
***
|
|
336
336
|
|
|
337
|
-
### someErrorClass()
|
|
337
|
+
### someErrorClass() {#someerrorclass}
|
|
338
338
|
|
|
339
339
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
340
340
|
|
|
@@ -366,7 +366,7 @@ True if the error has the specific class.
|
|
|
366
366
|
|
|
367
367
|
***
|
|
368
368
|
|
|
369
|
-
### someErrorCode()
|
|
369
|
+
### someErrorCode() {#someerrorcode}
|
|
370
370
|
|
|
371
371
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
372
372
|
|
|
@@ -382,9 +382,9 @@ The error to test.
|
|
|
382
382
|
|
|
383
383
|
##### code
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
`string` \| `RegExp`
|
|
386
386
|
|
|
387
|
-
|
|
387
|
+
The code to check for.
|
|
388
388
|
|
|
389
389
|
#### Returns
|
|
390
390
|
|
|
@@ -398,7 +398,7 @@ True if the error has the name.
|
|
|
398
398
|
|
|
399
399
|
***
|
|
400
400
|
|
|
401
|
-
### isEmpty()
|
|
401
|
+
### isEmpty() {#isempty}
|
|
402
402
|
|
|
403
403
|
> `static` **isEmpty**(`err`): `boolean`
|
|
404
404
|
|
|
@@ -424,7 +424,7 @@ True if the error is empty.
|
|
|
424
424
|
|
|
425
425
|
***
|
|
426
426
|
|
|
427
|
-
### isAggregateError()
|
|
427
|
+
### isAggregateError() {#isaggregateerror}
|
|
428
428
|
|
|
429
429
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
430
430
|
|
|
@@ -450,7 +450,7 @@ True if the error is an aggregate error.
|
|
|
450
450
|
|
|
451
451
|
***
|
|
452
452
|
|
|
453
|
-
### fromAggregate()
|
|
453
|
+
### fromAggregate() {#fromaggregate}
|
|
454
454
|
|
|
455
455
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
456
456
|
|
|
@@ -482,7 +482,7 @@ The array of errors.
|
|
|
482
482
|
|
|
483
483
|
***
|
|
484
484
|
|
|
485
|
-
### toJsonObject()
|
|
485
|
+
### toJsonObject() {#tojsonobject}
|
|
486
486
|
|
|
487
487
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
488
488
|
|