@twin.org/core 0.0.3-next.3 → 0.0.3-next.31

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (92) hide show
  1. package/README.md +1 -9
  2. package/dist/es/encoding/base32.js +1 -1
  3. package/dist/es/encoding/base32.js.map +1 -1
  4. package/dist/es/factories/factory.js +41 -0
  5. package/dist/es/factories/factory.js.map +1 -1
  6. package/dist/es/helpers/arrayHelper.js.map +1 -1
  7. package/dist/es/helpers/randomHelper.js +50 -2
  8. package/dist/es/helpers/randomHelper.js.map +1 -1
  9. package/dist/es/index.js +2 -1
  10. package/dist/es/index.js.map +1 -1
  11. package/dist/es/types/objectOrArray.js.map +1 -0
  12. package/dist/es/types/singleOccurrenceArray.js +2 -0
  13. package/dist/es/types/singleOccurrenceArray.js.map +1 -0
  14. package/dist/es/types/urn.js +1 -2
  15. package/dist/es/types/urn.js.map +1 -1
  16. package/dist/es/utils/asyncCache.js +102 -75
  17. package/dist/es/utils/asyncCache.js.map +1 -1
  18. package/dist/es/utils/guards.js +16 -0
  19. package/dist/es/utils/guards.js.map +1 -1
  20. package/dist/es/utils/is.js +16 -0
  21. package/dist/es/utils/is.js.map +1 -1
  22. package/dist/types/encoding/base32.d.ts +1 -1
  23. package/dist/types/factories/factory.d.ts +23 -1
  24. package/dist/types/helpers/arrayHelper.d.ts +1 -1
  25. package/dist/types/helpers/randomHelper.d.ts +16 -0
  26. package/dist/types/index.d.ts +2 -1
  27. package/dist/types/types/singleOccurrenceArray.d.ts +9 -0
  28. package/dist/types/utils/asyncCache.d.ts +7 -0
  29. package/dist/types/utils/guards.d.ts +10 -1
  30. package/dist/types/utils/is.d.ts +7 -0
  31. package/docs/changelog.md +541 -1
  32. package/docs/examples.md +308 -1
  33. package/docs/reference/classes/AlreadyExistsError.md +35 -35
  34. package/docs/reference/classes/ArrayHelper.md +2 -2
  35. package/docs/reference/classes/AsyncCache.md +8 -8
  36. package/docs/reference/classes/Base32.md +4 -4
  37. package/docs/reference/classes/Base58.md +3 -3
  38. package/docs/reference/classes/Base64.md +4 -4
  39. package/docs/reference/classes/Base64Url.md +3 -3
  40. package/docs/reference/classes/BaseError.md +34 -34
  41. package/docs/reference/classes/BitString.md +6 -6
  42. package/docs/reference/classes/Coerce.md +11 -11
  43. package/docs/reference/classes/Compression.md +3 -3
  44. package/docs/reference/classes/ConflictError.md +35 -35
  45. package/docs/reference/classes/Converter.md +18 -18
  46. package/docs/reference/classes/EnvHelper.md +1 -1
  47. package/docs/reference/classes/ErrorHelper.md +3 -3
  48. package/docs/reference/classes/Factory.md +112 -18
  49. package/docs/reference/classes/FilenameHelper.md +1 -1
  50. package/docs/reference/classes/GeneralError.md +35 -35
  51. package/docs/reference/classes/GuardError.md +35 -35
  52. package/docs/reference/classes/Guards.md +72 -30
  53. package/docs/reference/classes/HexHelper.md +6 -6
  54. package/docs/reference/classes/I18n.md +14 -14
  55. package/docs/reference/classes/Is.md +67 -39
  56. package/docs/reference/classes/JsonHelper.md +10 -10
  57. package/docs/reference/classes/NotFoundError.md +35 -35
  58. package/docs/reference/classes/NotImplementedError.md +35 -35
  59. package/docs/reference/classes/NotSupportedError.md +35 -35
  60. package/docs/reference/classes/NumberHelper.md +2 -2
  61. package/docs/reference/classes/ObjectHelper.md +32 -32
  62. package/docs/reference/classes/RandomHelper.md +53 -1
  63. package/docs/reference/classes/SharedStore.md +3 -3
  64. package/docs/reference/classes/StringHelper.md +23 -23
  65. package/docs/reference/classes/Uint8ArrayHelper.md +1 -1
  66. package/docs/reference/classes/UnauthorizedError.md +35 -35
  67. package/docs/reference/classes/UnprocessableError.md +35 -35
  68. package/docs/reference/classes/Url.md +8 -8
  69. package/docs/reference/classes/Urn.md +24 -24
  70. package/docs/reference/classes/Validation.md +25 -25
  71. package/docs/reference/classes/ValidationError.md +35 -35
  72. package/docs/reference/index.md +2 -0
  73. package/docs/reference/interfaces/IComponent.md +4 -4
  74. package/docs/reference/interfaces/IError.md +10 -10
  75. package/docs/reference/interfaces/II18nShared.md +4 -4
  76. package/docs/reference/interfaces/IKeyValue.md +2 -2
  77. package/docs/reference/interfaces/ILabelledValue.md +2 -2
  78. package/docs/reference/interfaces/ILocale.md +2 -2
  79. package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
  80. package/docs/reference/interfaces/ILocalesIndex.md +1 -1
  81. package/docs/reference/interfaces/IPatchOperation.md +6 -6
  82. package/docs/reference/interfaces/IUrlParts.md +9 -9
  83. package/docs/reference/interfaces/IValidationFailure.md +4 -4
  84. package/docs/reference/type-aliases/SingleOccurrenceArray.md +15 -0
  85. package/docs/reference/type-aliases/SingleOccurrenceArrayDepthHelper.md +19 -0
  86. package/docs/reference/variables/CoerceType.md +10 -10
  87. package/docs/reference/variables/CompressionType.md +2 -2
  88. package/locales/en.json +5 -2
  89. package/package.json +4 -4
  90. package/dist/es/models/objectOrArray.js.map +0 -1
  91. /package/dist/es/{models → types}/objectOrArray.js +0 -0
  92. /package/dist/types/{models → types}/objectOrArray.d.ts +0 -0
@@ -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**: `string`
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**: `object`
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**: [`IError`](../interfaces/IError.md)
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,7 +148,7 @@ The list of all internal errors.
148
148
 
149
149
  ***
150
150
 
151
- ### expand()
151
+ ### expand() {#expand}
152
152
 
153
153
  > `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
154
154
 
@@ -158,9 +158,9 @@ Expand an error tree.
158
158
 
159
159
  ##### errors
160
160
 
161
- The list of errors to expand.
161
+ [`IError`](../interfaces/IError.md)[] \| `undefined`
162
162
 
163
- [`IError`](../interfaces/IError.md)[] | `undefined`
163
+ The list of errors to expand.
164
164
 
165
165
  #### Returns
166
166
 
@@ -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
- The name to check for.
193
+ `string` \| `RegExp`
194
194
 
195
- `string` | `RegExp`
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
- The message to check for.
225
+ `string` \| `RegExp`
226
226
 
227
- `string` | `RegExp`
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
- The code to check for.
257
+ `string` \| `RegExp`
258
258
 
259
- `string` | `RegExp`
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
- The name to check for.
289
+ `string` \| `RegExp`
290
290
 
291
- `string` | `RegExp`
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
- The message to check for.
321
+ `string` \| `RegExp`
322
322
 
323
- `string` | `RegExp`
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
- The code to check for.
385
+ `string` \| `RegExp`
386
386
 
387
- `string` | `RegExp`
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
 
@@ -56,9 +56,9 @@ The property options which might be allowed.
56
56
 
57
57
  ## Properties
58
58
 
59
- ### source?
59
+ ### source? {#source}
60
60
 
61
- > `optional` **source**: `string`
61
+ > `optional` **source?**: `string`
62
62
 
63
63
  The source of the error.
64
64
 
@@ -68,9 +68,9 @@ The source of the error.
68
68
 
69
69
  ***
70
70
 
71
- ### properties?
71
+ ### properties? {#properties}
72
72
 
73
- > `optional` **properties**: `object`
73
+ > `optional` **properties?**: `object`
74
74
 
75
75
  Any additional information for the error.
76
76
 
@@ -84,9 +84,9 @@ Any additional information for the error.
84
84
 
85
85
  ***
86
86
 
87
- ### cause?
87
+ ### cause? {#cause}
88
88
 
89
- > `optional` **cause**: [`IError`](../interfaces/IError.md)
89
+ > `optional` **cause?**: [`IError`](../interfaces/IError.md)
90
90
 
91
91
  The cause of the error.
92
92
 
@@ -96,7 +96,7 @@ The cause of the error.
96
96
 
97
97
  ***
98
98
 
99
- ### CLASS\_NAME
99
+ ### CLASS\_NAME {#class_name}
100
100
 
101
101
  > `readonly` `static` **CLASS\_NAME**: `string`
102
102
 
@@ -104,7 +104,7 @@ Runtime name for the class.
104
104
 
105
105
  ## Methods
106
106
 
107
- ### fromError()
107
+ ### fromError() {#fromerror}
108
108
 
109
109
  > `static` **fromError**(`err`): [`BaseError`](BaseError.md)
110
110
 
@@ -130,7 +130,7 @@ The new instance.
130
130
 
131
131
  ***
132
132
 
133
- ### flatten()
133
+ ### flatten() {#flatten}
134
134
 
135
135
  > `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
136
136
 
@@ -156,7 +156,7 @@ The list of all internal errors.
156
156
 
157
157
  ***
158
158
 
159
- ### expand()
159
+ ### expand() {#expand}
160
160
 
161
161
  > `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
162
162
 
@@ -166,9 +166,9 @@ Expand an error tree.
166
166
 
167
167
  ##### errors
168
168
 
169
- The list of errors to expand.
169
+ [`IError`](../interfaces/IError.md)[] \| `undefined`
170
170
 
171
- [`IError`](../interfaces/IError.md)[] | `undefined`
171
+ The list of errors to expand.
172
172
 
173
173
  #### Returns
174
174
 
@@ -182,7 +182,7 @@ The first level error.
182
182
 
183
183
  ***
184
184
 
185
- ### isErrorName()
185
+ ### isErrorName() {#iserrorname}
186
186
 
187
187
  > `static` **isErrorName**(`error`, `name`): `error is BaseError`
188
188
 
@@ -198,9 +198,9 @@ The error to test.
198
198
 
199
199
  ##### name
200
200
 
201
- The name to check for.
201
+ `string` \| `RegExp`
202
202
 
203
- `string` | `RegExp`
203
+ The name to check for.
204
204
 
205
205
  #### Returns
206
206
 
@@ -214,7 +214,7 @@ True if the error has the name.
214
214
 
215
215
  ***
216
216
 
217
- ### isErrorMessage()
217
+ ### isErrorMessage() {#iserrormessage}
218
218
 
219
219
  > `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
220
220
 
@@ -230,9 +230,9 @@ The error to test.
230
230
 
231
231
  ##### message
232
232
 
233
- The message to check for.
233
+ `string` \| `RegExp`
234
234
 
235
- `string` | `RegExp`
235
+ The message to check for.
236
236
 
237
237
  #### Returns
238
238
 
@@ -246,7 +246,7 @@ True if the error has the name.
246
246
 
247
247
  ***
248
248
 
249
- ### isErrorCode()
249
+ ### isErrorCode() {#iserrorcode}
250
250
 
251
251
  > `static` **isErrorCode**(`error`, `code`): `boolean`
252
252
 
@@ -262,9 +262,9 @@ The error to test.
262
262
 
263
263
  ##### code
264
264
 
265
- The code to check for.
265
+ `string` \| `RegExp`
266
266
 
267
- `string` | `RegExp`
267
+ The code to check for.
268
268
 
269
269
  #### Returns
270
270
 
@@ -278,7 +278,7 @@ True if the error has the code.
278
278
 
279
279
  ***
280
280
 
281
- ### someErrorName()
281
+ ### someErrorName() {#someerrorname}
282
282
 
283
283
  > `static` **someErrorName**(`error`, `name`): `error is BaseError`
284
284
 
@@ -294,9 +294,9 @@ The error to test.
294
294
 
295
295
  ##### name
296
296
 
297
- The name to check for.
297
+ `string` \| `RegExp`
298
298
 
299
- `string` | `RegExp`
299
+ The name to check for.
300
300
 
301
301
  #### Returns
302
302
 
@@ -310,7 +310,7 @@ True if the error has the name.
310
310
 
311
311
  ***
312
312
 
313
- ### someErrorMessage()
313
+ ### someErrorMessage() {#someerrormessage}
314
314
 
315
315
  > `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
316
316
 
@@ -326,9 +326,9 @@ The error to test.
326
326
 
327
327
  ##### message
328
328
 
329
- The message to check for.
329
+ `string` \| `RegExp`
330
330
 
331
- `string` | `RegExp`
331
+ The message to check for.
332
332
 
333
333
  #### Returns
334
334
 
@@ -342,7 +342,7 @@ True if the error has the name.
342
342
 
343
343
  ***
344
344
 
345
- ### someErrorClass()
345
+ ### someErrorClass() {#someerrorclass}
346
346
 
347
347
  > `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
348
348
 
@@ -374,7 +374,7 @@ True if the error has the specific class.
374
374
 
375
375
  ***
376
376
 
377
- ### someErrorCode()
377
+ ### someErrorCode() {#someerrorcode}
378
378
 
379
379
  > `static` **someErrorCode**(`error`, `code`): `error is BaseError`
380
380
 
@@ -390,9 +390,9 @@ The error to test.
390
390
 
391
391
  ##### code
392
392
 
393
- The code to check for.
393
+ `string` \| `RegExp`
394
394
 
395
- `string` | `RegExp`
395
+ The code to check for.
396
396
 
397
397
  #### Returns
398
398
 
@@ -406,7 +406,7 @@ True if the error has the name.
406
406
 
407
407
  ***
408
408
 
409
- ### isEmpty()
409
+ ### isEmpty() {#isempty}
410
410
 
411
411
  > `static` **isEmpty**(`err`): `boolean`
412
412
 
@@ -432,7 +432,7 @@ True if the error is empty.
432
432
 
433
433
  ***
434
434
 
435
- ### isAggregateError()
435
+ ### isAggregateError() {#isaggregateerror}
436
436
 
437
437
  > `static` **isAggregateError**(`err`): `err is AggregateError`
438
438
 
@@ -458,7 +458,7 @@ True if the error is an aggregate error.
458
458
 
459
459
  ***
460
460
 
461
- ### fromAggregate()
461
+ ### fromAggregate() {#fromaggregate}
462
462
 
463
463
  > `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
464
464
 
@@ -490,7 +490,7 @@ The array of errors.
490
490
 
491
491
  ***
492
492
 
493
- ### toJsonObject()
493
+ ### toJsonObject() {#tojsonobject}
494
494
 
495
495
  > **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
496
496