@twin.org/core 0.0.2-next.8 → 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 +1240 -130
- 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
|
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by data not being found.
|
|
|
10
10
|
|
|
11
11
|
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new NotFoundError**(`source`, `message`, `notFoundId?`, `cause?`): `NotFoundError`
|
|
13
|
+
> **new NotFoundError**(`source`, `message`, `notFoundId?`, `properties?`, `cause?`): `NotFoundError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of NotFoundError.
|
|
16
16
|
|
|
@@ -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
|
##### notFoundId?
|
|
32
32
|
|
|
@@ -34,6 +34,10 @@ The message as a code.
|
|
|
34
34
|
|
|
35
35
|
The id for the item.
|
|
36
36
|
|
|
37
|
+
##### properties?
|
|
38
|
+
|
|
39
|
+
Any additional information for the error.
|
|
40
|
+
|
|
37
41
|
##### cause?
|
|
38
42
|
|
|
39
43
|
`unknown`
|
|
@@ -50,9 +54,9 @@ The cause of the error if we have wrapped another error.
|
|
|
50
54
|
|
|
51
55
|
## Properties
|
|
52
56
|
|
|
53
|
-
### source?
|
|
57
|
+
### source? {#source}
|
|
54
58
|
|
|
55
|
-
> `optional` **source
|
|
59
|
+
> `optional` **source?**: `string`
|
|
56
60
|
|
|
57
61
|
The source of the error.
|
|
58
62
|
|
|
@@ -62,9 +66,9 @@ The source of the error.
|
|
|
62
66
|
|
|
63
67
|
***
|
|
64
68
|
|
|
65
|
-
### properties?
|
|
69
|
+
### properties? {#properties}
|
|
66
70
|
|
|
67
|
-
> `optional` **properties
|
|
71
|
+
> `optional` **properties?**: `object`
|
|
68
72
|
|
|
69
73
|
Any additional information for the error.
|
|
70
74
|
|
|
@@ -78,9 +82,9 @@ Any additional information for the error.
|
|
|
78
82
|
|
|
79
83
|
***
|
|
80
84
|
|
|
81
|
-
### cause?
|
|
85
|
+
### cause? {#cause}
|
|
82
86
|
|
|
83
|
-
> `optional` **cause
|
|
87
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
84
88
|
|
|
85
89
|
The cause of the error.
|
|
86
90
|
|
|
@@ -90,7 +94,7 @@ The cause of the error.
|
|
|
90
94
|
|
|
91
95
|
***
|
|
92
96
|
|
|
93
|
-
### CLASS\_NAME
|
|
97
|
+
### CLASS\_NAME {#class_name}
|
|
94
98
|
|
|
95
99
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
96
100
|
|
|
@@ -98,7 +102,7 @@ Runtime name for the class.
|
|
|
98
102
|
|
|
99
103
|
## Methods
|
|
100
104
|
|
|
101
|
-
### fromError()
|
|
105
|
+
### fromError() {#fromerror}
|
|
102
106
|
|
|
103
107
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
104
108
|
|
|
@@ -124,7 +128,7 @@ The new instance.
|
|
|
124
128
|
|
|
125
129
|
***
|
|
126
130
|
|
|
127
|
-
### flatten()
|
|
131
|
+
### flatten() {#flatten}
|
|
128
132
|
|
|
129
133
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
130
134
|
|
|
@@ -150,9 +154,9 @@ The list of all internal errors.
|
|
|
150
154
|
|
|
151
155
|
***
|
|
152
156
|
|
|
153
|
-
### expand()
|
|
157
|
+
### expand() {#expand}
|
|
154
158
|
|
|
155
|
-
> `static` **expand**(`errors`):
|
|
159
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
156
160
|
|
|
157
161
|
Expand an error tree.
|
|
158
162
|
|
|
@@ -160,13 +164,13 @@ Expand an error tree.
|
|
|
160
164
|
|
|
161
165
|
##### errors
|
|
162
166
|
|
|
163
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
164
168
|
|
|
165
|
-
|
|
169
|
+
The list of errors to expand.
|
|
166
170
|
|
|
167
171
|
#### Returns
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
170
174
|
|
|
171
175
|
The first level error.
|
|
172
176
|
|
|
@@ -176,7 +180,7 @@ The first level error.
|
|
|
176
180
|
|
|
177
181
|
***
|
|
178
182
|
|
|
179
|
-
### isErrorName()
|
|
183
|
+
### isErrorName() {#iserrorname}
|
|
180
184
|
|
|
181
185
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
182
186
|
|
|
@@ -192,9 +196,9 @@ The error to test.
|
|
|
192
196
|
|
|
193
197
|
##### name
|
|
194
198
|
|
|
195
|
-
|
|
199
|
+
`string` \| `RegExp`
|
|
196
200
|
|
|
197
|
-
|
|
201
|
+
The name to check for.
|
|
198
202
|
|
|
199
203
|
#### Returns
|
|
200
204
|
|
|
@@ -208,7 +212,7 @@ True if the error has the name.
|
|
|
208
212
|
|
|
209
213
|
***
|
|
210
214
|
|
|
211
|
-
### isErrorMessage()
|
|
215
|
+
### isErrorMessage() {#iserrormessage}
|
|
212
216
|
|
|
213
217
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
214
218
|
|
|
@@ -224,9 +228,9 @@ The error to test.
|
|
|
224
228
|
|
|
225
229
|
##### message
|
|
226
230
|
|
|
227
|
-
|
|
231
|
+
`string` \| `RegExp`
|
|
228
232
|
|
|
229
|
-
|
|
233
|
+
The message to check for.
|
|
230
234
|
|
|
231
235
|
#### Returns
|
|
232
236
|
|
|
@@ -240,7 +244,7 @@ True if the error has the name.
|
|
|
240
244
|
|
|
241
245
|
***
|
|
242
246
|
|
|
243
|
-
### isErrorCode()
|
|
247
|
+
### isErrorCode() {#iserrorcode}
|
|
244
248
|
|
|
245
249
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
246
250
|
|
|
@@ -256,9 +260,9 @@ The error to test.
|
|
|
256
260
|
|
|
257
261
|
##### code
|
|
258
262
|
|
|
259
|
-
|
|
263
|
+
`string` \| `RegExp`
|
|
260
264
|
|
|
261
|
-
|
|
265
|
+
The code to check for.
|
|
262
266
|
|
|
263
267
|
#### Returns
|
|
264
268
|
|
|
@@ -272,7 +276,7 @@ True if the error has the code.
|
|
|
272
276
|
|
|
273
277
|
***
|
|
274
278
|
|
|
275
|
-
### someErrorName()
|
|
279
|
+
### someErrorName() {#someerrorname}
|
|
276
280
|
|
|
277
281
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
278
282
|
|
|
@@ -288,9 +292,9 @@ The error to test.
|
|
|
288
292
|
|
|
289
293
|
##### name
|
|
290
294
|
|
|
291
|
-
|
|
295
|
+
`string` \| `RegExp`
|
|
292
296
|
|
|
293
|
-
|
|
297
|
+
The name to check for.
|
|
294
298
|
|
|
295
299
|
#### Returns
|
|
296
300
|
|
|
@@ -304,7 +308,7 @@ True if the error has the name.
|
|
|
304
308
|
|
|
305
309
|
***
|
|
306
310
|
|
|
307
|
-
### someErrorMessage()
|
|
311
|
+
### someErrorMessage() {#someerrormessage}
|
|
308
312
|
|
|
309
313
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
310
314
|
|
|
@@ -320,9 +324,9 @@ The error to test.
|
|
|
320
324
|
|
|
321
325
|
##### message
|
|
322
326
|
|
|
323
|
-
|
|
327
|
+
`string` \| `RegExp`
|
|
324
328
|
|
|
325
|
-
|
|
329
|
+
The message to check for.
|
|
326
330
|
|
|
327
331
|
#### Returns
|
|
328
332
|
|
|
@@ -336,7 +340,7 @@ True if the error has the name.
|
|
|
336
340
|
|
|
337
341
|
***
|
|
338
342
|
|
|
339
|
-
### someErrorClass()
|
|
343
|
+
### someErrorClass() {#someerrorclass}
|
|
340
344
|
|
|
341
345
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
342
346
|
|
|
@@ -368,7 +372,7 @@ True if the error has the specific class.
|
|
|
368
372
|
|
|
369
373
|
***
|
|
370
374
|
|
|
371
|
-
### someErrorCode()
|
|
375
|
+
### someErrorCode() {#someerrorcode}
|
|
372
376
|
|
|
373
377
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
374
378
|
|
|
@@ -384,9 +388,9 @@ The error to test.
|
|
|
384
388
|
|
|
385
389
|
##### code
|
|
386
390
|
|
|
387
|
-
|
|
391
|
+
`string` \| `RegExp`
|
|
388
392
|
|
|
389
|
-
|
|
393
|
+
The code to check for.
|
|
390
394
|
|
|
391
395
|
#### Returns
|
|
392
396
|
|
|
@@ -400,7 +404,7 @@ True if the error has the name.
|
|
|
400
404
|
|
|
401
405
|
***
|
|
402
406
|
|
|
403
|
-
### isEmpty()
|
|
407
|
+
### isEmpty() {#isempty}
|
|
404
408
|
|
|
405
409
|
> `static` **isEmpty**(`err`): `boolean`
|
|
406
410
|
|
|
@@ -426,7 +430,7 @@ True if the error is empty.
|
|
|
426
430
|
|
|
427
431
|
***
|
|
428
432
|
|
|
429
|
-
### isAggregateError()
|
|
433
|
+
### isAggregateError() {#isaggregateerror}
|
|
430
434
|
|
|
431
435
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
432
436
|
|
|
@@ -452,7 +456,7 @@ True if the error is an aggregate error.
|
|
|
452
456
|
|
|
453
457
|
***
|
|
454
458
|
|
|
455
|
-
### fromAggregate()
|
|
459
|
+
### fromAggregate() {#fromaggregate}
|
|
456
460
|
|
|
457
461
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
458
462
|
|
|
@@ -484,7 +488,7 @@ The array of errors.
|
|
|
484
488
|
|
|
485
489
|
***
|
|
486
490
|
|
|
487
|
-
### toJsonObject()
|
|
491
|
+
### toJsonObject() {#tojsonobject}
|
|
488
492
|
|
|
489
493
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
490
494
|
|
|
@@ -10,7 +10,7 @@ Class to handle errors.
|
|
|
10
10
|
|
|
11
11
|
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new NotImplementedError**(`source`, `method`): `NotImplementedError`
|
|
13
|
+
> **new NotImplementedError**(`source`, `method`, `properties?`, `cause?`): `NotImplementedError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of NotImplementedError.
|
|
16
16
|
|
|
@@ -28,6 +28,16 @@ The source of the error.
|
|
|
28
28
|
|
|
29
29
|
The method for the error.
|
|
30
30
|
|
|
31
|
+
##### properties?
|
|
32
|
+
|
|
33
|
+
Any additional information for the error.
|
|
34
|
+
|
|
35
|
+
##### cause?
|
|
36
|
+
|
|
37
|
+
`unknown`
|
|
38
|
+
|
|
39
|
+
The cause of the error if we have wrapped another error.
|
|
40
|
+
|
|
31
41
|
#### Returns
|
|
32
42
|
|
|
33
43
|
`NotImplementedError`
|
|
@@ -38,9 +48,9 @@ The method for the error.
|
|
|
38
48
|
|
|
39
49
|
## Properties
|
|
40
50
|
|
|
41
|
-
### source?
|
|
51
|
+
### source? {#source}
|
|
42
52
|
|
|
43
|
-
> `optional` **source
|
|
53
|
+
> `optional` **source?**: `string`
|
|
44
54
|
|
|
45
55
|
The source of the error.
|
|
46
56
|
|
|
@@ -50,9 +60,9 @@ The source of the error.
|
|
|
50
60
|
|
|
51
61
|
***
|
|
52
62
|
|
|
53
|
-
### properties?
|
|
63
|
+
### properties? {#properties}
|
|
54
64
|
|
|
55
|
-
> `optional` **properties
|
|
65
|
+
> `optional` **properties?**: `object`
|
|
56
66
|
|
|
57
67
|
Any additional information for the error.
|
|
58
68
|
|
|
@@ -66,9 +76,9 @@ Any additional information for the error.
|
|
|
66
76
|
|
|
67
77
|
***
|
|
68
78
|
|
|
69
|
-
### cause?
|
|
79
|
+
### cause? {#cause}
|
|
70
80
|
|
|
71
|
-
> `optional` **cause
|
|
81
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
72
82
|
|
|
73
83
|
The cause of the error.
|
|
74
84
|
|
|
@@ -78,7 +88,7 @@ The cause of the error.
|
|
|
78
88
|
|
|
79
89
|
***
|
|
80
90
|
|
|
81
|
-
### CLASS\_NAME
|
|
91
|
+
### CLASS\_NAME {#class_name}
|
|
82
92
|
|
|
83
93
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
84
94
|
|
|
@@ -86,7 +96,7 @@ Runtime name for the class.
|
|
|
86
96
|
|
|
87
97
|
## Methods
|
|
88
98
|
|
|
89
|
-
### fromError()
|
|
99
|
+
### fromError() {#fromerror}
|
|
90
100
|
|
|
91
101
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
92
102
|
|
|
@@ -112,7 +122,7 @@ The new instance.
|
|
|
112
122
|
|
|
113
123
|
***
|
|
114
124
|
|
|
115
|
-
### flatten()
|
|
125
|
+
### flatten() {#flatten}
|
|
116
126
|
|
|
117
127
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
118
128
|
|
|
@@ -138,9 +148,9 @@ The list of all internal errors.
|
|
|
138
148
|
|
|
139
149
|
***
|
|
140
150
|
|
|
141
|
-
### expand()
|
|
151
|
+
### expand() {#expand}
|
|
142
152
|
|
|
143
|
-
> `static` **expand**(`errors`):
|
|
153
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
144
154
|
|
|
145
155
|
Expand an error tree.
|
|
146
156
|
|
|
@@ -148,13 +158,13 @@ Expand an error tree.
|
|
|
148
158
|
|
|
149
159
|
##### errors
|
|
150
160
|
|
|
151
|
-
|
|
161
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
152
162
|
|
|
153
|
-
|
|
163
|
+
The list of errors to expand.
|
|
154
164
|
|
|
155
165
|
#### Returns
|
|
156
166
|
|
|
157
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
158
168
|
|
|
159
169
|
The first level error.
|
|
160
170
|
|
|
@@ -164,7 +174,7 @@ The first level error.
|
|
|
164
174
|
|
|
165
175
|
***
|
|
166
176
|
|
|
167
|
-
### isErrorName()
|
|
177
|
+
### isErrorName() {#iserrorname}
|
|
168
178
|
|
|
169
179
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
170
180
|
|
|
@@ -180,9 +190,9 @@ The error to test.
|
|
|
180
190
|
|
|
181
191
|
##### name
|
|
182
192
|
|
|
183
|
-
|
|
193
|
+
`string` \| `RegExp`
|
|
184
194
|
|
|
185
|
-
|
|
195
|
+
The name to check for.
|
|
186
196
|
|
|
187
197
|
#### Returns
|
|
188
198
|
|
|
@@ -196,7 +206,7 @@ True if the error has the name.
|
|
|
196
206
|
|
|
197
207
|
***
|
|
198
208
|
|
|
199
|
-
### isErrorMessage()
|
|
209
|
+
### isErrorMessage() {#iserrormessage}
|
|
200
210
|
|
|
201
211
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
202
212
|
|
|
@@ -212,9 +222,9 @@ The error to test.
|
|
|
212
222
|
|
|
213
223
|
##### message
|
|
214
224
|
|
|
215
|
-
|
|
225
|
+
`string` \| `RegExp`
|
|
216
226
|
|
|
217
|
-
|
|
227
|
+
The message to check for.
|
|
218
228
|
|
|
219
229
|
#### Returns
|
|
220
230
|
|
|
@@ -228,7 +238,7 @@ True if the error has the name.
|
|
|
228
238
|
|
|
229
239
|
***
|
|
230
240
|
|
|
231
|
-
### isErrorCode()
|
|
241
|
+
### isErrorCode() {#iserrorcode}
|
|
232
242
|
|
|
233
243
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
234
244
|
|
|
@@ -244,9 +254,9 @@ The error to test.
|
|
|
244
254
|
|
|
245
255
|
##### code
|
|
246
256
|
|
|
247
|
-
|
|
257
|
+
`string` \| `RegExp`
|
|
248
258
|
|
|
249
|
-
|
|
259
|
+
The code to check for.
|
|
250
260
|
|
|
251
261
|
#### Returns
|
|
252
262
|
|
|
@@ -260,7 +270,7 @@ True if the error has the code.
|
|
|
260
270
|
|
|
261
271
|
***
|
|
262
272
|
|
|
263
|
-
### someErrorName()
|
|
273
|
+
### someErrorName() {#someerrorname}
|
|
264
274
|
|
|
265
275
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
266
276
|
|
|
@@ -276,9 +286,9 @@ The error to test.
|
|
|
276
286
|
|
|
277
287
|
##### name
|
|
278
288
|
|
|
279
|
-
|
|
289
|
+
`string` \| `RegExp`
|
|
280
290
|
|
|
281
|
-
|
|
291
|
+
The name to check for.
|
|
282
292
|
|
|
283
293
|
#### Returns
|
|
284
294
|
|
|
@@ -292,7 +302,7 @@ True if the error has the name.
|
|
|
292
302
|
|
|
293
303
|
***
|
|
294
304
|
|
|
295
|
-
### someErrorMessage()
|
|
305
|
+
### someErrorMessage() {#someerrormessage}
|
|
296
306
|
|
|
297
307
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
298
308
|
|
|
@@ -308,9 +318,9 @@ The error to test.
|
|
|
308
318
|
|
|
309
319
|
##### message
|
|
310
320
|
|
|
311
|
-
|
|
321
|
+
`string` \| `RegExp`
|
|
312
322
|
|
|
313
|
-
|
|
323
|
+
The message to check for.
|
|
314
324
|
|
|
315
325
|
#### Returns
|
|
316
326
|
|
|
@@ -324,7 +334,7 @@ True if the error has the name.
|
|
|
324
334
|
|
|
325
335
|
***
|
|
326
336
|
|
|
327
|
-
### someErrorClass()
|
|
337
|
+
### someErrorClass() {#someerrorclass}
|
|
328
338
|
|
|
329
339
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
330
340
|
|
|
@@ -356,7 +366,7 @@ True if the error has the specific class.
|
|
|
356
366
|
|
|
357
367
|
***
|
|
358
368
|
|
|
359
|
-
### someErrorCode()
|
|
369
|
+
### someErrorCode() {#someerrorcode}
|
|
360
370
|
|
|
361
371
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
362
372
|
|
|
@@ -372,9 +382,9 @@ The error to test.
|
|
|
372
382
|
|
|
373
383
|
##### code
|
|
374
384
|
|
|
375
|
-
|
|
385
|
+
`string` \| `RegExp`
|
|
376
386
|
|
|
377
|
-
|
|
387
|
+
The code to check for.
|
|
378
388
|
|
|
379
389
|
#### Returns
|
|
380
390
|
|
|
@@ -388,7 +398,7 @@ True if the error has the name.
|
|
|
388
398
|
|
|
389
399
|
***
|
|
390
400
|
|
|
391
|
-
### isEmpty()
|
|
401
|
+
### isEmpty() {#isempty}
|
|
392
402
|
|
|
393
403
|
> `static` **isEmpty**(`err`): `boolean`
|
|
394
404
|
|
|
@@ -414,7 +424,7 @@ True if the error is empty.
|
|
|
414
424
|
|
|
415
425
|
***
|
|
416
426
|
|
|
417
|
-
### isAggregateError()
|
|
427
|
+
### isAggregateError() {#isaggregateerror}
|
|
418
428
|
|
|
419
429
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
420
430
|
|
|
@@ -440,7 +450,7 @@ True if the error is an aggregate error.
|
|
|
440
450
|
|
|
441
451
|
***
|
|
442
452
|
|
|
443
|
-
### fromAggregate()
|
|
453
|
+
### fromAggregate() {#fromaggregate}
|
|
444
454
|
|
|
445
455
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
446
456
|
|
|
@@ -472,7 +482,7 @@ The array of errors.
|
|
|
472
482
|
|
|
473
483
|
***
|
|
474
484
|
|
|
475
|
-
### toJsonObject()
|
|
485
|
+
### toJsonObject() {#tojsonobject}
|
|
476
486
|
|
|
477
487
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
478
488
|
|