@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
@@ -60,9 +60,9 @@ The cause or the error if we have wrapped another error.
60
60
 
61
61
  ## Properties
62
62
 
63
- ### source?
63
+ ### source? {#source}
64
64
 
65
- > `optional` **source**: `string`
65
+ > `optional` **source?**: `string`
66
66
 
67
67
  The source of the error.
68
68
 
@@ -72,9 +72,9 @@ The source of the error.
72
72
 
73
73
  ***
74
74
 
75
- ### properties?
75
+ ### properties? {#properties}
76
76
 
77
- > `optional` **properties**: `object`
77
+ > `optional` **properties?**: `object`
78
78
 
79
79
  Any additional information for the error.
80
80
 
@@ -88,9 +88,9 @@ Any additional information for the error.
88
88
 
89
89
  ***
90
90
 
91
- ### cause?
91
+ ### cause? {#cause}
92
92
 
93
- > `optional` **cause**: [`IError`](../interfaces/IError.md)
93
+ > `optional` **cause?**: [`IError`](../interfaces/IError.md)
94
94
 
95
95
  The cause of the error.
96
96
 
@@ -100,7 +100,7 @@ The cause of the error.
100
100
 
101
101
  ***
102
102
 
103
- ### CLASS\_NAME
103
+ ### CLASS\_NAME {#class_name}
104
104
 
105
105
  > `readonly` `static` **CLASS\_NAME**: `string`
106
106
 
@@ -108,7 +108,7 @@ Runtime name for the class.
108
108
 
109
109
  ## Methods
110
110
 
111
- ### fromError()
111
+ ### fromError() {#fromerror}
112
112
 
113
113
  > `static` **fromError**(`err`): [`BaseError`](BaseError.md)
114
114
 
@@ -134,7 +134,7 @@ The new instance.
134
134
 
135
135
  ***
136
136
 
137
- ### flatten()
137
+ ### flatten() {#flatten}
138
138
 
139
139
  > `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
140
140
 
@@ -160,7 +160,7 @@ The list of all internal errors.
160
160
 
161
161
  ***
162
162
 
163
- ### expand()
163
+ ### expand() {#expand}
164
164
 
165
165
  > `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
166
166
 
@@ -170,9 +170,9 @@ Expand an error tree.
170
170
 
171
171
  ##### errors
172
172
 
173
- The list of errors to expand.
173
+ [`IError`](../interfaces/IError.md)[] \| `undefined`
174
174
 
175
- [`IError`](../interfaces/IError.md)[] | `undefined`
175
+ The list of errors to expand.
176
176
 
177
177
  #### Returns
178
178
 
@@ -186,7 +186,7 @@ The first level error.
186
186
 
187
187
  ***
188
188
 
189
- ### isErrorName()
189
+ ### isErrorName() {#iserrorname}
190
190
 
191
191
  > `static` **isErrorName**(`error`, `name`): `error is BaseError`
192
192
 
@@ -202,9 +202,9 @@ The error to test.
202
202
 
203
203
  ##### name
204
204
 
205
- The name to check for.
205
+ `string` \| `RegExp`
206
206
 
207
- `string` | `RegExp`
207
+ The name to check for.
208
208
 
209
209
  #### Returns
210
210
 
@@ -218,7 +218,7 @@ True if the error has the name.
218
218
 
219
219
  ***
220
220
 
221
- ### isErrorMessage()
221
+ ### isErrorMessage() {#iserrormessage}
222
222
 
223
223
  > `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
224
224
 
@@ -234,9 +234,9 @@ The error to test.
234
234
 
235
235
  ##### message
236
236
 
237
- The message to check for.
237
+ `string` \| `RegExp`
238
238
 
239
- `string` | `RegExp`
239
+ The message to check for.
240
240
 
241
241
  #### Returns
242
242
 
@@ -250,7 +250,7 @@ True if the error has the name.
250
250
 
251
251
  ***
252
252
 
253
- ### isErrorCode()
253
+ ### isErrorCode() {#iserrorcode}
254
254
 
255
255
  > `static` **isErrorCode**(`error`, `code`): `boolean`
256
256
 
@@ -266,9 +266,9 @@ The error to test.
266
266
 
267
267
  ##### code
268
268
 
269
- The code to check for.
269
+ `string` \| `RegExp`
270
270
 
271
- `string` | `RegExp`
271
+ The code to check for.
272
272
 
273
273
  #### Returns
274
274
 
@@ -282,7 +282,7 @@ True if the error has the code.
282
282
 
283
283
  ***
284
284
 
285
- ### someErrorName()
285
+ ### someErrorName() {#someerrorname}
286
286
 
287
287
  > `static` **someErrorName**(`error`, `name`): `error is BaseError`
288
288
 
@@ -298,9 +298,9 @@ The error to test.
298
298
 
299
299
  ##### name
300
300
 
301
- The name to check for.
301
+ `string` \| `RegExp`
302
302
 
303
- `string` | `RegExp`
303
+ The name to check for.
304
304
 
305
305
  #### Returns
306
306
 
@@ -314,7 +314,7 @@ True if the error has the name.
314
314
 
315
315
  ***
316
316
 
317
- ### someErrorMessage()
317
+ ### someErrorMessage() {#someerrormessage}
318
318
 
319
319
  > `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
320
320
 
@@ -330,9 +330,9 @@ The error to test.
330
330
 
331
331
  ##### message
332
332
 
333
- The message to check for.
333
+ `string` \| `RegExp`
334
334
 
335
- `string` | `RegExp`
335
+ The message to check for.
336
336
 
337
337
  #### Returns
338
338
 
@@ -346,7 +346,7 @@ True if the error has the name.
346
346
 
347
347
  ***
348
348
 
349
- ### someErrorClass()
349
+ ### someErrorClass() {#someerrorclass}
350
350
 
351
351
  > `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
352
352
 
@@ -378,7 +378,7 @@ True if the error has the specific class.
378
378
 
379
379
  ***
380
380
 
381
- ### someErrorCode()
381
+ ### someErrorCode() {#someerrorcode}
382
382
 
383
383
  > `static` **someErrorCode**(`error`, `code`): `error is BaseError`
384
384
 
@@ -394,9 +394,9 @@ The error to test.
394
394
 
395
395
  ##### code
396
396
 
397
- The code to check for.
397
+ `string` \| `RegExp`
398
398
 
399
- `string` | `RegExp`
399
+ The code to check for.
400
400
 
401
401
  #### Returns
402
402
 
@@ -410,7 +410,7 @@ True if the error has the name.
410
410
 
411
411
  ***
412
412
 
413
- ### isEmpty()
413
+ ### isEmpty() {#isempty}
414
414
 
415
415
  > `static` **isEmpty**(`err`): `boolean`
416
416
 
@@ -436,7 +436,7 @@ True if the error is empty.
436
436
 
437
437
  ***
438
438
 
439
- ### isAggregateError()
439
+ ### isAggregateError() {#isaggregateerror}
440
440
 
441
441
  > `static` **isAggregateError**(`err`): `err is AggregateError`
442
442
 
@@ -462,7 +462,7 @@ True if the error is an aggregate error.
462
462
 
463
463
  ***
464
464
 
465
- ### fromAggregate()
465
+ ### fromAggregate() {#fromaggregate}
466
466
 
467
467
  > `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
468
468
 
@@ -494,7 +494,7 @@ The array of errors.
494
494
 
495
495
  ***
496
496
 
497
- ### toJsonObject()
497
+ ### toJsonObject() {#tojsonobject}
498
498
 
499
499
  > **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
500
500
 
@@ -14,7 +14,7 @@ Convert arrays to and from different formats.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### bytesToUtf8()
17
+ ### bytesToUtf8() {#bytestoutf8}
18
18
 
19
19
  > `static` **bytesToUtf8**(`array`, `startIndex?`, `length?`): `string`
20
20
 
@@ -48,7 +48,7 @@ The array formatted as UTF8.
48
48
 
49
49
  ***
50
50
 
51
- ### utf8ToBytes()
51
+ ### utf8ToBytes() {#utf8tobytes}
52
52
 
53
53
  > `static` **utf8ToBytes**(`utf8`): `Uint8Array`
54
54
 
@@ -70,9 +70,9 @@ The array.
70
70
 
71
71
  ***
72
72
 
73
- ### bytesToHex()
73
+ ### bytesToHex() {#bytestohex}
74
74
 
75
- > `static` **bytesToHex**(`array`, `includePrefix`, `startIndex?`, `length?`, `reverse?`): `string`
75
+ > `static` **bytesToHex**(`array`, `includePrefix?`, `startIndex?`, `length?`, `reverse?`): `string`
76
76
 
77
77
  Encode a raw array to hex string.
78
78
 
@@ -84,7 +84,7 @@ Encode a raw array to hex string.
84
84
 
85
85
  The bytes to encode.
86
86
 
87
- ##### includePrefix
87
+ ##### includePrefix?
88
88
 
89
89
  `boolean` = `false`
90
90
 
@@ -116,7 +116,7 @@ The array formatted as hex.
116
116
 
117
117
  ***
118
118
 
119
- ### hexToBytes()
119
+ ### hexToBytes() {#hextobytes}
120
120
 
121
121
  > `static` **hexToBytes**(`hex`, `reverse?`): `Uint8Array`
122
122
 
@@ -144,9 +144,9 @@ The array.
144
144
 
145
145
  ***
146
146
 
147
- ### utf8ToHex()
147
+ ### utf8ToHex() {#utf8tohex}
148
148
 
149
- > `static` **utf8ToHex**(`utf8`, `includePrefix`): `string`
149
+ > `static` **utf8ToHex**(`utf8`, `includePrefix?`): `string`
150
150
 
151
151
  Convert the UTF8 to hex.
152
152
 
@@ -158,7 +158,7 @@ Convert the UTF8 to hex.
158
158
 
159
159
  The text to convert.
160
160
 
161
- ##### includePrefix
161
+ ##### includePrefix?
162
162
 
163
163
  `boolean` = `false`
164
164
 
@@ -172,7 +172,7 @@ The hex version of the bytes.
172
172
 
173
173
  ***
174
174
 
175
- ### hexToUtf8()
175
+ ### hexToUtf8() {#hextoutf8}
176
176
 
177
177
  > `static` **hexToUtf8**(`hex`): `string`
178
178
 
@@ -194,7 +194,7 @@ The UTF8 version of the bytes.
194
194
 
195
195
  ***
196
196
 
197
- ### bytesToBinary()
197
+ ### bytesToBinary() {#bytestobinary}
198
198
 
199
199
  > `static` **bytesToBinary**(`bytes`): `string`
200
200
 
@@ -216,7 +216,7 @@ A binary string of the bytes.
216
216
 
217
217
  ***
218
218
 
219
- ### binaryToBytes()
219
+ ### binaryToBytes() {#binarytobytes}
220
220
 
221
221
  > `static` **binaryToBytes**(`binary`): `Uint8Array`
222
222
 
@@ -238,7 +238,7 @@ The bytes.
238
238
 
239
239
  ***
240
240
 
241
- ### bytesToBase64()
241
+ ### bytesToBase64() {#bytestobase64}
242
242
 
243
243
  > `static` **bytesToBase64**(`bytes`): `string`
244
244
 
@@ -260,7 +260,7 @@ A base64 string of the bytes.
260
260
 
261
261
  ***
262
262
 
263
- ### base64ToBytes()
263
+ ### base64ToBytes() {#base64tobytes}
264
264
 
265
265
  > `static` **base64ToBytes**(`base64`): `Uint8Array`
266
266
 
@@ -282,7 +282,7 @@ The bytes.
282
282
 
283
283
  ***
284
284
 
285
- ### bytesToBase64Url()
285
+ ### bytesToBase64Url() {#bytestobase64url}
286
286
 
287
287
  > `static` **bytesToBase64Url**(`bytes`): `string`
288
288
 
@@ -304,7 +304,7 @@ A base64 url string of the bytes.
304
304
 
305
305
  ***
306
306
 
307
- ### base64UrlToBytes()
307
+ ### base64UrlToBytes() {#base64urltobytes}
308
308
 
309
309
  > `static` **base64UrlToBytes**(`base64Url`): `Uint8Array`
310
310
 
@@ -326,7 +326,7 @@ The bytes.
326
326
 
327
327
  ***
328
328
 
329
- ### bytesToBase58()
329
+ ### bytesToBase58() {#bytestobase58}
330
330
 
331
331
  > `static` **bytesToBase58**(`bytes`): `string`
332
332
 
@@ -348,7 +348,7 @@ A base58 string of the bytes.
348
348
 
349
349
  ***
350
350
 
351
- ### base58ToBytes()
351
+ ### base58ToBytes() {#base58tobytes}
352
352
 
353
353
  > `static` **base58ToBytes**(`base58`): `Uint8Array`
354
354
 
@@ -14,7 +14,7 @@ Environment variable helper.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### envToJson()
17
+ ### envToJson() {#envtojson}
18
18
 
19
19
  > `static` **envToJson**\<`T`\>(`envVars`, `prefix?`): `T`
20
20
 
@@ -14,7 +14,7 @@ Error helper functions.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### formatErrors()
17
+ ### formatErrors() {#formaterrors}
18
18
 
19
19
  > `static` **formatErrors**(`error`, `includeDetails?`): `string`[]
20
20
 
@@ -42,7 +42,7 @@ The error formatted including any causes errors.
42
42
 
43
43
  ***
44
44
 
45
- ### localizeErrors()
45
+ ### localizeErrors() {#localizeerrors}
46
46
 
47
47
  > `static` **localizeErrors**(`error`): [`IError`](../interfaces/IError.md)[]
48
48
 
@@ -64,7 +64,7 @@ The localized version of the errors flattened.
64
64
 
65
65
  ***
66
66
 
67
- ### formatValidationErrors()
67
+ ### formatValidationErrors() {#formatvalidationerrors}
68
68
 
69
69
  > `static` **formatValidationErrors**(`error`): `string` \| `undefined`
70
70
 
@@ -10,7 +10,7 @@ Factory for creating implementation of generic types.
10
10
 
11
11
  ## Properties
12
12
 
13
- ### CLASS\_NAME
13
+ ### CLASS\_NAME {#class_name}
14
14
 
15
15
  > `readonly` `static` **CLASS\_NAME**: `string`
16
16
 
@@ -18,9 +18,9 @@ Runtime name for the class.
18
18
 
19
19
  ## Methods
20
20
 
21
- ### createFactory()
21
+ ### createFactory() {#createfactory}
22
22
 
23
- > `static` **createFactory**\<`U`\>(`typeName`, `autoInstance`, `matcher?`): `Factory`\<`U`\>
23
+ > `static` **createFactory**\<`U`\>(`typeName`, `autoInstance?`, `matcher?`): `Factory`\<`U`\>
24
24
 
25
25
  Create a new factory, which is shared throughout all library instances.
26
26
 
@@ -38,7 +38,7 @@ Create a new factory, which is shared throughout all library instances.
38
38
 
39
39
  The type name for the instances.
40
40
 
41
- ##### autoInstance
41
+ ##### autoInstance?
42
42
 
43
43
  `boolean` = `false`
44
44
 
@@ -58,7 +58,7 @@ The factory instance.
58
58
 
59
59
  ***
60
60
 
61
- ### getFactories()
61
+ ### getFactories() {#getfactories}
62
62
 
63
63
  > `static` **getFactories**(): `object`
64
64
 
@@ -72,7 +72,7 @@ All the factories.
72
72
 
73
73
  ***
74
74
 
75
- ### resetFactories()
75
+ ### resetFactories() {#resetfactories}
76
76
 
77
77
  > `static` **resetFactories**(): `void`
78
78
 
@@ -84,7 +84,7 @@ Reset all the factories, which removes any created instances, but not the regist
84
84
 
85
85
  ***
86
86
 
87
- ### clearFactories()
87
+ ### clearFactories() {#clearfactories}
88
88
 
89
89
  > `static` **clearFactories**(): `void`
90
90
 
@@ -96,7 +96,21 @@ Clear all the factories, which removes anything registered with the factories.
96
96
 
97
97
  ***
98
98
 
99
- ### register()
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}
100
114
 
101
115
  > **register**\<`U`\>(`name`, `generator`): `void`
102
116
 
@@ -118,7 +132,7 @@ The name of the generator.
118
132
 
119
133
  ##### generator
120
134
 
121
- () => `U`
135
+ (`args?`) => `U`
122
136
 
123
137
  The function to create an instance.
124
138
 
@@ -128,7 +142,7 @@ The function to create an instance.
128
142
 
129
143
  ***
130
144
 
131
- ### unregister()
145
+ ### unregister() {#unregister}
132
146
 
133
147
  > **unregister**(`name`): `void`
134
148
 
@@ -156,7 +170,7 @@ GeneralError if no generator exists.
156
170
 
157
171
  ***
158
172
 
159
- ### get()
173
+ ### get() {#get}
160
174
 
161
175
  > **get**\<`U`\>(`name`): `U`
162
176
 
@@ -192,7 +206,7 @@ GeneralError if no item exists to get.
192
206
 
193
207
  ***
194
208
 
195
- ### getIfExists()
209
+ ### getIfExists() {#getifexists}
196
210
 
197
211
  > **getIfExists**\<`U`\>(`name?`): `U` \| `undefined`
198
212
 
@@ -220,7 +234,87 @@ An instance of the item or undefined if it does not exist.
220
234
 
221
235
  ***
222
236
 
223
- ### reset()
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}
224
318
 
225
319
  > **reset**(): `void`
226
320
 
@@ -232,7 +326,7 @@ Remove all the instances and leave the generators intact.
232
326
 
233
327
  ***
234
328
 
235
- ### clear()
329
+ ### clear() {#clear}
236
330
 
237
331
  > **clear**(): `void`
238
332
 
@@ -244,7 +338,7 @@ Remove all the instances and the generators.
244
338
 
245
339
  ***
246
340
 
247
- ### instancesMap()
341
+ ### instancesMap() {#instancesmap}
248
342
 
249
343
  > **instancesMap**(): `object`
250
344
 
@@ -258,7 +352,7 @@ The instances as a map.
258
352
 
259
353
  ***
260
354
 
261
- ### instancesList()
355
+ ### instancesList() {#instanceslist}
262
356
 
263
357
  > **instancesList**(): `T`[]
264
358
 
@@ -272,7 +366,7 @@ The instances as a list in the order they were registered.
272
366
 
273
367
  ***
274
368
 
275
- ### names()
369
+ ### names() {#names}
276
370
 
277
371
  > **names**(): `string`[]
278
372
 
@@ -286,7 +380,7 @@ The ordered generator names.
286
380
 
287
381
  ***
288
382
 
289
- ### hasName()
383
+ ### hasName() {#hasname}
290
384
 
291
385
  > **hasName**(`name`): `boolean`
292
386
 
@@ -14,7 +14,7 @@ Class to help with filenames.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### safeFilename()
17
+ ### safeFilename() {#safefilename}
18
18
 
19
19
  > `static` **safeFilename**(`filename`): `string`
20
20