@twin.org/core 0.0.1-next.1

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.
Files changed (103) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +29 -0
  3. package/dist/cjs/index.cjs +4221 -0
  4. package/dist/esm/index.mjs +4184 -0
  5. package/dist/types/encoding/base32.d.ts +18 -0
  6. package/dist/types/encoding/base64.d.ts +24 -0
  7. package/dist/types/encoding/base64Url.d.ts +18 -0
  8. package/dist/types/errors/alreadyExistsError.d.ts +18 -0
  9. package/dist/types/errors/baseError.d.ts +103 -0
  10. package/dist/types/errors/conflictError.d.ts +19 -0
  11. package/dist/types/errors/generalError.d.ts +20 -0
  12. package/dist/types/errors/guardError.d.ts +19 -0
  13. package/dist/types/errors/notFoundError.d.ts +18 -0
  14. package/dist/types/errors/notImplementedError.d.ts +16 -0
  15. package/dist/types/errors/notSupportedError.d.ts +17 -0
  16. package/dist/types/errors/unauthorizedError.d.ts +17 -0
  17. package/dist/types/errors/unprocessableError.d.ts +20 -0
  18. package/dist/types/errors/validationError.d.ts +18 -0
  19. package/dist/types/factories/componentFactory.d.ts +6 -0
  20. package/dist/types/factories/factory.d.ts +67 -0
  21. package/dist/types/helpers/arrayHelper.d.ts +12 -0
  22. package/dist/types/helpers/errorHelper.d.ts +24 -0
  23. package/dist/types/helpers/filenameHelper.d.ts +11 -0
  24. package/dist/types/helpers/hexHelper.d.ts +30 -0
  25. package/dist/types/helpers/jsonHelper.d.ts +29 -0
  26. package/dist/types/helpers/objectHelper.d.ts +74 -0
  27. package/dist/types/helpers/randomHelper.d.ts +11 -0
  28. package/dist/types/helpers/stringHelper.d.ts +90 -0
  29. package/dist/types/index.d.ts +46 -0
  30. package/dist/types/models/IComponent.d.ts +29 -0
  31. package/dist/types/models/IError.d.ts +31 -0
  32. package/dist/types/models/IKeyValue.d.ts +13 -0
  33. package/dist/types/models/ILabelledValue.d.ts +13 -0
  34. package/dist/types/models/ILocale.d.ts +13 -0
  35. package/dist/types/models/ILocaleDictionary.d.ts +6 -0
  36. package/dist/types/models/ILocalesIndex.d.ts +10 -0
  37. package/dist/types/models/IPatchOperation.d.ts +21 -0
  38. package/dist/types/models/IUrlParts.d.ts +29 -0
  39. package/dist/types/models/IValidationFailure.d.ts +23 -0
  40. package/dist/types/models/compressionType.d.ts +17 -0
  41. package/dist/types/types/bitString.d.ts +41 -0
  42. package/dist/types/types/url.d.ts +56 -0
  43. package/dist/types/types/urn.d.ts +93 -0
  44. package/dist/types/utils/asyncCache.d.ts +33 -0
  45. package/dist/types/utils/coerce.d.ts +61 -0
  46. package/dist/types/utils/compression.d.ts +20 -0
  47. package/dist/types/utils/converter.d.ts +85 -0
  48. package/dist/types/utils/guards.d.ts +190 -0
  49. package/dist/types/utils/i18n.d.ts +81 -0
  50. package/dist/types/utils/is.d.ts +205 -0
  51. package/dist/types/utils/validation.d.ts +245 -0
  52. package/docs/changelog.md +5 -0
  53. package/docs/examples.md +1 -0
  54. package/docs/reference/classes/AlreadyExistsError.md +375 -0
  55. package/docs/reference/classes/ArrayHelper.md +37 -0
  56. package/docs/reference/classes/AsyncCache.md +117 -0
  57. package/docs/reference/classes/Base32.md +57 -0
  58. package/docs/reference/classes/Base64.md +74 -0
  59. package/docs/reference/classes/Base64Url.md +54 -0
  60. package/docs/reference/classes/BaseError.md +344 -0
  61. package/docs/reference/classes/BitString.md +123 -0
  62. package/docs/reference/classes/Coerce.md +209 -0
  63. package/docs/reference/classes/Compression.md +61 -0
  64. package/docs/reference/classes/ConflictError.md +379 -0
  65. package/docs/reference/classes/Converter.md +285 -0
  66. package/docs/reference/classes/ErrorHelper.md +73 -0
  67. package/docs/reference/classes/Factory.md +221 -0
  68. package/docs/reference/classes/FilenameHelper.md +33 -0
  69. package/docs/reference/classes/GeneralError.md +375 -0
  70. package/docs/reference/classes/GuardError.md +379 -0
  71. package/docs/reference/classes/Guards.md +711 -0
  72. package/docs/reference/classes/HexHelper.md +97 -0
  73. package/docs/reference/classes/I18n.md +237 -0
  74. package/docs/reference/classes/Is.md +693 -0
  75. package/docs/reference/classes/JsonHelper.md +92 -0
  76. package/docs/reference/classes/NotFoundError.md +375 -0
  77. package/docs/reference/classes/NotImplementedError.md +367 -0
  78. package/docs/reference/classes/NotSupportedError.md +371 -0
  79. package/docs/reference/classes/ObjectHelper.md +287 -0
  80. package/docs/reference/classes/RandomHelper.md +33 -0
  81. package/docs/reference/classes/StringHelper.md +270 -0
  82. package/docs/reference/classes/UnauthorizedError.md +371 -0
  83. package/docs/reference/classes/UnprocessableError.md +375 -0
  84. package/docs/reference/classes/Url.md +167 -0
  85. package/docs/reference/classes/Urn.md +295 -0
  86. package/docs/reference/classes/Validation.md +821 -0
  87. package/docs/reference/classes/ValidationError.md +371 -0
  88. package/docs/reference/index.md +60 -0
  89. package/docs/reference/interfaces/IComponent.md +79 -0
  90. package/docs/reference/interfaces/IError.md +55 -0
  91. package/docs/reference/interfaces/IKeyValue.md +23 -0
  92. package/docs/reference/interfaces/ILabelledValue.md +23 -0
  93. package/docs/reference/interfaces/ILocale.md +19 -0
  94. package/docs/reference/interfaces/ILocaleDictionary.md +7 -0
  95. package/docs/reference/interfaces/ILocalesIndex.md +11 -0
  96. package/docs/reference/interfaces/IPatchOperation.md +35 -0
  97. package/docs/reference/interfaces/IUrlParts.md +51 -0
  98. package/docs/reference/interfaces/IValidationFailure.md +39 -0
  99. package/docs/reference/type-aliases/CompressionType.md +5 -0
  100. package/docs/reference/variables/ComponentFactory.md +5 -0
  101. package/docs/reference/variables/CompressionType.md +19 -0
  102. package/locales/en.json +98 -0
  103. package/package.json +65 -0
@@ -0,0 +1,367 @@
1
+ # Class: NotImplementedError
2
+
3
+ Class to handle errors.
4
+
5
+ ## Extends
6
+
7
+ - [`BaseError`](BaseError.md)
8
+
9
+ ## Constructors
10
+
11
+ ### new NotImplementedError()
12
+
13
+ > **new NotImplementedError**(`source`, `method`): [`NotImplementedError`](NotImplementedError.md)
14
+
15
+ Create a new instance of NotImplementedError.
16
+
17
+ #### Parameters
18
+
19
+ • **source**: `string`
20
+
21
+ The source of the error.
22
+
23
+ • **method**: `string`
24
+
25
+ The method for the error.
26
+
27
+ #### Returns
28
+
29
+ [`NotImplementedError`](NotImplementedError.md)
30
+
31
+ #### Overrides
32
+
33
+ [`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructors)
34
+
35
+ ## Properties
36
+
37
+ ### source?
38
+
39
+ > `optional` **source**: `string`
40
+
41
+ The source of the error.
42
+
43
+ #### Inherited from
44
+
45
+ [`BaseError`](BaseError.md).[`source`](BaseError.md#source)
46
+
47
+ ***
48
+
49
+ ### properties?
50
+
51
+ > `optional` **properties**: `object`
52
+
53
+ Any additional information for the error.
54
+
55
+ #### Index Signature
56
+
57
+ \[`id`: `string`\]: `unknown`
58
+
59
+ #### Inherited from
60
+
61
+ [`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
62
+
63
+ ***
64
+
65
+ ### inner?
66
+
67
+ > `optional` **inner**: [`IError`](../interfaces/IError.md)
68
+
69
+ The inner error if there was one.
70
+
71
+ #### Inherited from
72
+
73
+ [`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
74
+
75
+ ***
76
+
77
+ ### CLASS\_NAME
78
+
79
+ > `readonly` `static` **CLASS\_NAME**: `string`
80
+
81
+ Runtime name for the class.
82
+
83
+ ## Methods
84
+
85
+ ### fromError()
86
+
87
+ > `static` **fromError**(`err`): [`BaseError`](BaseError.md)
88
+
89
+ Construct an error from an existing one.
90
+
91
+ #### Parameters
92
+
93
+ • **err**: `unknown`
94
+
95
+ The existing error.
96
+
97
+ #### Returns
98
+
99
+ [`BaseError`](BaseError.md)
100
+
101
+ The new instance.
102
+
103
+ #### Inherited from
104
+
105
+ [`BaseError`](BaseError.md).[`fromError`](BaseError.md#fromerror)
106
+
107
+ ***
108
+
109
+ ### flatten()
110
+
111
+ > `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
112
+
113
+ Flatten an error tree.
114
+
115
+ #### Parameters
116
+
117
+ • **err**: `unknown`
118
+
119
+ The starting error.
120
+
121
+ #### Returns
122
+
123
+ [`IError`](../interfaces/IError.md)[]
124
+
125
+ The list of all internal errors.
126
+
127
+ #### Inherited from
128
+
129
+ [`BaseError`](BaseError.md).[`flatten`](BaseError.md#flatten)
130
+
131
+ ***
132
+
133
+ ### expand()
134
+
135
+ > `static` **expand**(`errors`): `undefined` \| [`IError`](../interfaces/IError.md)
136
+
137
+ Expand an error tree.
138
+
139
+ #### Parameters
140
+
141
+ • **errors**: `undefined` \| [`IError`](../interfaces/IError.md)[]
142
+
143
+ The list of errors to expand.
144
+
145
+ #### Returns
146
+
147
+ `undefined` \| [`IError`](../interfaces/IError.md)
148
+
149
+ The first level error.
150
+
151
+ #### Inherited from
152
+
153
+ [`BaseError`](BaseError.md).[`expand`](BaseError.md#expand)
154
+
155
+ ***
156
+
157
+ ### isErrorName()
158
+
159
+ > `static` **isErrorName**(`error`, `name`): `error is BaseError`
160
+
161
+ Test to see if the error has the specified error name.
162
+
163
+ #### Parameters
164
+
165
+ • **error**: `unknown`
166
+
167
+ The error to test.
168
+
169
+ • **name**: `string` \| `RegExp`
170
+
171
+ The name to check for.
172
+
173
+ #### Returns
174
+
175
+ `error is BaseError`
176
+
177
+ True if the error has the name.
178
+
179
+ #### Inherited from
180
+
181
+ [`BaseError`](BaseError.md).[`isErrorName`](BaseError.md#iserrorname)
182
+
183
+ ***
184
+
185
+ ### isErrorMessage()
186
+
187
+ > `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
188
+
189
+ Test to see if the error has the specified error message.
190
+
191
+ #### Parameters
192
+
193
+ • **error**: `unknown`
194
+
195
+ The error to test.
196
+
197
+ • **message**: `string` \| `RegExp`
198
+
199
+ The message to check for.
200
+
201
+ #### Returns
202
+
203
+ `error is BaseError`
204
+
205
+ True if the error has the name.
206
+
207
+ #### Inherited from
208
+
209
+ [`BaseError`](BaseError.md).[`isErrorMessage`](BaseError.md#iserrormessage)
210
+
211
+ ***
212
+
213
+ ### isErrorCode()
214
+
215
+ > `static` **isErrorCode**(`error`, `code`): `boolean`
216
+
217
+ Test to see if the error has the specified error code.
218
+
219
+ #### Parameters
220
+
221
+ • **error**: `unknown`
222
+
223
+ The error to test.
224
+
225
+ • **code**: `string` \| `RegExp`
226
+
227
+ The code to check for.
228
+
229
+ #### Returns
230
+
231
+ `boolean`
232
+
233
+ True if the error has the code.
234
+
235
+ #### Inherited from
236
+
237
+ [`BaseError`](BaseError.md).[`isErrorCode`](BaseError.md#iserrorcode)
238
+
239
+ ***
240
+
241
+ ### someErrorName()
242
+
243
+ > `static` **someErrorName**(`error`, `name`): `error is BaseError`
244
+
245
+ Test to see if any of the errors or children have the given error name.
246
+
247
+ #### Parameters
248
+
249
+ • **error**: `unknown`
250
+
251
+ The error to test.
252
+
253
+ • **name**: `string` \| `RegExp`
254
+
255
+ The name to check for.
256
+
257
+ #### Returns
258
+
259
+ `error is BaseError`
260
+
261
+ True if the error has the name.
262
+
263
+ #### Inherited from
264
+
265
+ [`BaseError`](BaseError.md).[`someErrorName`](BaseError.md#someerrorname)
266
+
267
+ ***
268
+
269
+ ### someErrorMessage()
270
+
271
+ > `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
272
+
273
+ Test to see if any of the errors or children have the given error message.
274
+
275
+ #### Parameters
276
+
277
+ • **error**: `unknown`
278
+
279
+ The error to test.
280
+
281
+ • **message**: `string` \| `RegExp`
282
+
283
+ The message to check for.
284
+
285
+ #### Returns
286
+
287
+ `error is BaseError`
288
+
289
+ True if the error has the name.
290
+
291
+ #### Inherited from
292
+
293
+ [`BaseError`](BaseError.md).[`someErrorMessage`](BaseError.md#someerrormessage)
294
+
295
+ ***
296
+
297
+ ### someErrorClass()
298
+
299
+ > `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
300
+
301
+ Test to see if any of the errors or children are from a specific class.
302
+
303
+ #### Parameters
304
+
305
+ • **error**: `unknown`
306
+
307
+ The error to test.
308
+
309
+ • **cls**: `string`
310
+
311
+ The class to check for.
312
+
313
+ #### Returns
314
+
315
+ `error is BaseError`
316
+
317
+ True if the error has the specific class.
318
+
319
+ #### Inherited from
320
+
321
+ [`BaseError`](BaseError.md).[`someErrorClass`](BaseError.md#someerrorclass)
322
+
323
+ ***
324
+
325
+ ### someErrorCode()
326
+
327
+ > `static` **someErrorCode**(`error`, `code`): `error is BaseError`
328
+
329
+ Test to see if any of the errors or children have the given error code.
330
+
331
+ #### Parameters
332
+
333
+ • **error**: `unknown`
334
+
335
+ The error to test.
336
+
337
+ • **code**: `string` \| `RegExp`
338
+
339
+ The code to check for.
340
+
341
+ #### Returns
342
+
343
+ `error is BaseError`
344
+
345
+ True if the error has the name.
346
+
347
+ #### Inherited from
348
+
349
+ [`BaseError`](BaseError.md).[`someErrorCode`](BaseError.md#someerrorcode)
350
+
351
+ ***
352
+
353
+ ### toJsonObject()
354
+
355
+ > **toJsonObject**(): [`IError`](../interfaces/IError.md)
356
+
357
+ Serialize the error to the error model.
358
+
359
+ #### Returns
360
+
361
+ [`IError`](../interfaces/IError.md)
362
+
363
+ The error model.
364
+
365
+ #### Inherited from
366
+
367
+ [`BaseError`](BaseError.md).[`toJsonObject`](BaseError.md#tojsonobject)
@@ -0,0 +1,371 @@
1
+ # Class: NotSupportedError
2
+
3
+ Class to handle errors when a feature is unsupported.
4
+
5
+ ## Extends
6
+
7
+ - [`BaseError`](BaseError.md)
8
+
9
+ ## Constructors
10
+
11
+ ### new NotSupportedError()
12
+
13
+ > **new NotSupportedError**(`source`, `message`, `inner`?): [`NotSupportedError`](NotSupportedError.md)
14
+
15
+ Create a new instance of NotSupportedError.
16
+
17
+ #### Parameters
18
+
19
+ • **source**: `string`
20
+
21
+ The source of the error.
22
+
23
+ • **message**: `string`
24
+
25
+ The message as a code.
26
+
27
+ • **inner?**: `unknown`
28
+
29
+ The inner error if we have wrapped another error.
30
+
31
+ #### Returns
32
+
33
+ [`NotSupportedError`](NotSupportedError.md)
34
+
35
+ #### Overrides
36
+
37
+ [`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructors)
38
+
39
+ ## Properties
40
+
41
+ ### source?
42
+
43
+ > `optional` **source**: `string`
44
+
45
+ The source of the error.
46
+
47
+ #### Inherited from
48
+
49
+ [`BaseError`](BaseError.md).[`source`](BaseError.md#source)
50
+
51
+ ***
52
+
53
+ ### properties?
54
+
55
+ > `optional` **properties**: `object`
56
+
57
+ Any additional information for the error.
58
+
59
+ #### Index Signature
60
+
61
+ \[`id`: `string`\]: `unknown`
62
+
63
+ #### Inherited from
64
+
65
+ [`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
66
+
67
+ ***
68
+
69
+ ### inner?
70
+
71
+ > `optional` **inner**: [`IError`](../interfaces/IError.md)
72
+
73
+ The inner error if there was one.
74
+
75
+ #### Inherited from
76
+
77
+ [`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
78
+
79
+ ***
80
+
81
+ ### CLASS\_NAME
82
+
83
+ > `readonly` `static` **CLASS\_NAME**: `string`
84
+
85
+ Runtime name for the class.
86
+
87
+ ## Methods
88
+
89
+ ### fromError()
90
+
91
+ > `static` **fromError**(`err`): [`BaseError`](BaseError.md)
92
+
93
+ Construct an error from an existing one.
94
+
95
+ #### Parameters
96
+
97
+ • **err**: `unknown`
98
+
99
+ The existing error.
100
+
101
+ #### Returns
102
+
103
+ [`BaseError`](BaseError.md)
104
+
105
+ The new instance.
106
+
107
+ #### Inherited from
108
+
109
+ [`BaseError`](BaseError.md).[`fromError`](BaseError.md#fromerror)
110
+
111
+ ***
112
+
113
+ ### flatten()
114
+
115
+ > `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
116
+
117
+ Flatten an error tree.
118
+
119
+ #### Parameters
120
+
121
+ • **err**: `unknown`
122
+
123
+ The starting error.
124
+
125
+ #### Returns
126
+
127
+ [`IError`](../interfaces/IError.md)[]
128
+
129
+ The list of all internal errors.
130
+
131
+ #### Inherited from
132
+
133
+ [`BaseError`](BaseError.md).[`flatten`](BaseError.md#flatten)
134
+
135
+ ***
136
+
137
+ ### expand()
138
+
139
+ > `static` **expand**(`errors`): `undefined` \| [`IError`](../interfaces/IError.md)
140
+
141
+ Expand an error tree.
142
+
143
+ #### Parameters
144
+
145
+ • **errors**: `undefined` \| [`IError`](../interfaces/IError.md)[]
146
+
147
+ The list of errors to expand.
148
+
149
+ #### Returns
150
+
151
+ `undefined` \| [`IError`](../interfaces/IError.md)
152
+
153
+ The first level error.
154
+
155
+ #### Inherited from
156
+
157
+ [`BaseError`](BaseError.md).[`expand`](BaseError.md#expand)
158
+
159
+ ***
160
+
161
+ ### isErrorName()
162
+
163
+ > `static` **isErrorName**(`error`, `name`): `error is BaseError`
164
+
165
+ Test to see if the error has the specified error name.
166
+
167
+ #### Parameters
168
+
169
+ • **error**: `unknown`
170
+
171
+ The error to test.
172
+
173
+ • **name**: `string` \| `RegExp`
174
+
175
+ The name to check for.
176
+
177
+ #### Returns
178
+
179
+ `error is BaseError`
180
+
181
+ True if the error has the name.
182
+
183
+ #### Inherited from
184
+
185
+ [`BaseError`](BaseError.md).[`isErrorName`](BaseError.md#iserrorname)
186
+
187
+ ***
188
+
189
+ ### isErrorMessage()
190
+
191
+ > `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
192
+
193
+ Test to see if the error has the specified error message.
194
+
195
+ #### Parameters
196
+
197
+ • **error**: `unknown`
198
+
199
+ The error to test.
200
+
201
+ • **message**: `string` \| `RegExp`
202
+
203
+ The message to check for.
204
+
205
+ #### Returns
206
+
207
+ `error is BaseError`
208
+
209
+ True if the error has the name.
210
+
211
+ #### Inherited from
212
+
213
+ [`BaseError`](BaseError.md).[`isErrorMessage`](BaseError.md#iserrormessage)
214
+
215
+ ***
216
+
217
+ ### isErrorCode()
218
+
219
+ > `static` **isErrorCode**(`error`, `code`): `boolean`
220
+
221
+ Test to see if the error has the specified error code.
222
+
223
+ #### Parameters
224
+
225
+ • **error**: `unknown`
226
+
227
+ The error to test.
228
+
229
+ • **code**: `string` \| `RegExp`
230
+
231
+ The code to check for.
232
+
233
+ #### Returns
234
+
235
+ `boolean`
236
+
237
+ True if the error has the code.
238
+
239
+ #### Inherited from
240
+
241
+ [`BaseError`](BaseError.md).[`isErrorCode`](BaseError.md#iserrorcode)
242
+
243
+ ***
244
+
245
+ ### someErrorName()
246
+
247
+ > `static` **someErrorName**(`error`, `name`): `error is BaseError`
248
+
249
+ Test to see if any of the errors or children have the given error name.
250
+
251
+ #### Parameters
252
+
253
+ • **error**: `unknown`
254
+
255
+ The error to test.
256
+
257
+ • **name**: `string` \| `RegExp`
258
+
259
+ The name to check for.
260
+
261
+ #### Returns
262
+
263
+ `error is BaseError`
264
+
265
+ True if the error has the name.
266
+
267
+ #### Inherited from
268
+
269
+ [`BaseError`](BaseError.md).[`someErrorName`](BaseError.md#someerrorname)
270
+
271
+ ***
272
+
273
+ ### someErrorMessage()
274
+
275
+ > `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
276
+
277
+ Test to see if any of the errors or children have the given error message.
278
+
279
+ #### Parameters
280
+
281
+ • **error**: `unknown`
282
+
283
+ The error to test.
284
+
285
+ • **message**: `string` \| `RegExp`
286
+
287
+ The message to check for.
288
+
289
+ #### Returns
290
+
291
+ `error is BaseError`
292
+
293
+ True if the error has the name.
294
+
295
+ #### Inherited from
296
+
297
+ [`BaseError`](BaseError.md).[`someErrorMessage`](BaseError.md#someerrormessage)
298
+
299
+ ***
300
+
301
+ ### someErrorClass()
302
+
303
+ > `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
304
+
305
+ Test to see if any of the errors or children are from a specific class.
306
+
307
+ #### Parameters
308
+
309
+ • **error**: `unknown`
310
+
311
+ The error to test.
312
+
313
+ • **cls**: `string`
314
+
315
+ The class to check for.
316
+
317
+ #### Returns
318
+
319
+ `error is BaseError`
320
+
321
+ True if the error has the specific class.
322
+
323
+ #### Inherited from
324
+
325
+ [`BaseError`](BaseError.md).[`someErrorClass`](BaseError.md#someerrorclass)
326
+
327
+ ***
328
+
329
+ ### someErrorCode()
330
+
331
+ > `static` **someErrorCode**(`error`, `code`): `error is BaseError`
332
+
333
+ Test to see if any of the errors or children have the given error code.
334
+
335
+ #### Parameters
336
+
337
+ • **error**: `unknown`
338
+
339
+ The error to test.
340
+
341
+ • **code**: `string` \| `RegExp`
342
+
343
+ The code to check for.
344
+
345
+ #### Returns
346
+
347
+ `error is BaseError`
348
+
349
+ True if the error has the name.
350
+
351
+ #### Inherited from
352
+
353
+ [`BaseError`](BaseError.md).[`someErrorCode`](BaseError.md#someerrorcode)
354
+
355
+ ***
356
+
357
+ ### toJsonObject()
358
+
359
+ > **toJsonObject**(): [`IError`](../interfaces/IError.md)
360
+
361
+ Serialize the error to the error model.
362
+
363
+ #### Returns
364
+
365
+ [`IError`](../interfaces/IError.md)
366
+
367
+ The error model.
368
+
369
+ #### Inherited from
370
+
371
+ [`BaseError`](BaseError.md).[`toJsonObject`](BaseError.md#tojsonobject)