@twin.org/core 0.0.3-next.21 → 0.0.3-next.23

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 (78) 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 +1 -13
  5. package/dist/es/factories/factory.js.map +1 -1
  6. package/dist/es/helpers/arrayHelper.js.map +1 -1
  7. package/dist/es/index.js +2 -1
  8. package/dist/es/index.js.map +1 -1
  9. package/dist/es/types/objectOrArray.js.map +1 -0
  10. package/dist/es/types/singleOccurrenceArray.js +2 -0
  11. package/dist/es/types/singleOccurrenceArray.js.map +1 -0
  12. package/dist/es/utils/guards.js.map +1 -1
  13. package/dist/types/encoding/base32.d.ts +1 -1
  14. package/dist/types/factories/factory.d.ts +1 -5
  15. package/dist/types/helpers/arrayHelper.d.ts +1 -1
  16. package/dist/types/index.d.ts +2 -1
  17. package/dist/types/types/singleOccurrenceArray.d.ts +9 -0
  18. package/dist/types/utils/guards.d.ts +1 -1
  19. package/docs/changelog.md +36 -1
  20. package/docs/examples.md +308 -1
  21. package/docs/reference/classes/AlreadyExistsError.md +18 -18
  22. package/docs/reference/classes/ArrayHelper.md +2 -2
  23. package/docs/reference/classes/AsyncCache.md +6 -6
  24. package/docs/reference/classes/Base32.md +4 -4
  25. package/docs/reference/classes/Base58.md +3 -3
  26. package/docs/reference/classes/Base64.md +4 -4
  27. package/docs/reference/classes/Base64Url.md +3 -3
  28. package/docs/reference/classes/BaseError.md +17 -17
  29. package/docs/reference/classes/BitString.md +6 -6
  30. package/docs/reference/classes/Coerce.md +11 -11
  31. package/docs/reference/classes/Compression.md +3 -3
  32. package/docs/reference/classes/ConflictError.md +18 -18
  33. package/docs/reference/classes/Converter.md +18 -18
  34. package/docs/reference/classes/EnvHelper.md +1 -1
  35. package/docs/reference/classes/ErrorHelper.md +3 -3
  36. package/docs/reference/classes/Factory.md +21 -31
  37. package/docs/reference/classes/FilenameHelper.md +1 -1
  38. package/docs/reference/classes/GeneralError.md +18 -18
  39. package/docs/reference/classes/GuardError.md +18 -18
  40. package/docs/reference/classes/Guards.md +31 -31
  41. package/docs/reference/classes/HexHelper.md +6 -6
  42. package/docs/reference/classes/I18n.md +14 -14
  43. package/docs/reference/classes/Is.md +40 -40
  44. package/docs/reference/classes/JsonHelper.md +8 -8
  45. package/docs/reference/classes/NotFoundError.md +18 -18
  46. package/docs/reference/classes/NotImplementedError.md +18 -18
  47. package/docs/reference/classes/NotSupportedError.md +18 -18
  48. package/docs/reference/classes/NumberHelper.md +2 -2
  49. package/docs/reference/classes/ObjectHelper.md +20 -20
  50. package/docs/reference/classes/RandomHelper.md +6 -6
  51. package/docs/reference/classes/SharedStore.md +3 -3
  52. package/docs/reference/classes/StringHelper.md +23 -23
  53. package/docs/reference/classes/Uint8ArrayHelper.md +1 -1
  54. package/docs/reference/classes/UnauthorizedError.md +18 -18
  55. package/docs/reference/classes/UnprocessableError.md +18 -18
  56. package/docs/reference/classes/Url.md +8 -8
  57. package/docs/reference/classes/Urn.md +22 -22
  58. package/docs/reference/classes/Validation.md +25 -25
  59. package/docs/reference/classes/ValidationError.md +18 -18
  60. package/docs/reference/index.md +2 -0
  61. package/docs/reference/interfaces/IComponent.md +4 -4
  62. package/docs/reference/interfaces/IError.md +6 -6
  63. package/docs/reference/interfaces/II18nShared.md +4 -4
  64. package/docs/reference/interfaces/IKeyValue.md +2 -2
  65. package/docs/reference/interfaces/ILabelledValue.md +2 -2
  66. package/docs/reference/interfaces/ILocale.md +2 -2
  67. package/docs/reference/interfaces/ILocalesIndex.md +1 -1
  68. package/docs/reference/interfaces/IPatchOperation.md +4 -4
  69. package/docs/reference/interfaces/IUrlParts.md +6 -6
  70. package/docs/reference/interfaces/IValidationFailure.md +3 -3
  71. package/docs/reference/type-aliases/SingleOccurrenceArray.md +15 -0
  72. package/docs/reference/type-aliases/SingleOccurrenceArrayDepthHelper.md +19 -0
  73. package/docs/reference/variables/CoerceType.md +10 -10
  74. package/docs/reference/variables/CompressionType.md +2 -2
  75. package/package.json +4 -4
  76. package/dist/es/models/objectOrArray.js.map +0 -1
  77. /package/dist/es/{models → types}/objectOrArray.js +0 -0
  78. /package/dist/types/{models → types}/objectOrArray.d.ts +0 -0
@@ -14,7 +14,7 @@ Class to handle guard operations for parameters.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### defined()
17
+ ### defined() {#defined}
18
18
 
19
19
  > `static` **defined**(`source`, `property`, `value`): `asserts value`
20
20
 
@@ -50,7 +50,7 @@ GuardError If the value does not match the assertion.
50
50
 
51
51
  ***
52
52
 
53
- ### string()
53
+ ### string() {#string}
54
54
 
55
55
  > `static` **string**(`source`, `property`, `value`): `asserts value is string`
56
56
 
@@ -86,7 +86,7 @@ GuardError If the value does not match the assertion.
86
86
 
87
87
  ***
88
88
 
89
- ### stringValue()
89
+ ### stringValue() {#stringvalue}
90
90
 
91
91
  > `static` **stringValue**(`source`, `property`, `value`): `asserts value is string`
92
92
 
@@ -122,7 +122,7 @@ GuardError If the value does not match the assertion.
122
122
 
123
123
  ***
124
124
 
125
- ### json()
125
+ ### json() {#json}
126
126
 
127
127
  > `static` **json**(`source`, `property`, `value`): `asserts value is string`
128
128
 
@@ -158,7 +158,7 @@ GuardError If the value does not match the assertion.
158
158
 
159
159
  ***
160
160
 
161
- ### stringBase64()
161
+ ### stringBase64() {#stringbase64}
162
162
 
163
163
  > `static` **stringBase64**(`source`, `property`, `value`): `asserts value is string`
164
164
 
@@ -194,7 +194,7 @@ GuardError If the value does not match the assertion.
194
194
 
195
195
  ***
196
196
 
197
- ### stringBase64Url()
197
+ ### stringBase64Url() {#stringbase64url}
198
198
 
199
199
  > `static` **stringBase64Url**(`source`, `property`, `value`): `asserts value is string`
200
200
 
@@ -230,7 +230,7 @@ GuardError If the value does not match the assertion.
230
230
 
231
231
  ***
232
232
 
233
- ### stringBase58()
233
+ ### stringBase58() {#stringbase58}
234
234
 
235
235
  > `static` **stringBase58**(`source`, `property`, `value`): `asserts value is string`
236
236
 
@@ -266,9 +266,9 @@ GuardError If the value does not match the assertion.
266
266
 
267
267
  ***
268
268
 
269
- ### stringHex()
269
+ ### stringHex() {#stringhex}
270
270
 
271
- > `static` **stringHex**(`source`, `property`, `value`, `allowPrefix`): `asserts value is string`
271
+ > `static` **stringHex**(`source`, `property`, `value`, `allowPrefix?`): `asserts value is string`
272
272
 
273
273
  Is the property a string with a hex value.
274
274
 
@@ -292,7 +292,7 @@ The name of the property.
292
292
 
293
293
  The value to test.
294
294
 
295
- ##### allowPrefix
295
+ ##### allowPrefix?
296
296
 
297
297
  `boolean` = `false`
298
298
 
@@ -308,9 +308,9 @@ GuardError If the value does not match the assertion.
308
308
 
309
309
  ***
310
310
 
311
- ### stringHexLength()
311
+ ### stringHexLength() {#stringhexlength}
312
312
 
313
- > `static` **stringHexLength**(`source`, `property`, `value`, `length`, `allowPrefix`): `asserts value is string`
313
+ > `static` **stringHexLength**(`source`, `property`, `value`, `length`, `allowPrefix?`): `asserts value is string`
314
314
 
315
315
  Is the property a string with a hex value with fixed length.
316
316
 
@@ -340,7 +340,7 @@ The value to test.
340
340
 
341
341
  The length of the string to match.
342
342
 
343
- ##### allowPrefix
343
+ ##### allowPrefix?
344
344
 
345
345
  `boolean` = `false`
346
346
 
@@ -356,7 +356,7 @@ GuardError If the value does not match the assertion.
356
356
 
357
357
  ***
358
358
 
359
- ### number()
359
+ ### number() {#number}
360
360
 
361
361
  > `static` **number**(`source`, `property`, `value`): `asserts value is number`
362
362
 
@@ -392,7 +392,7 @@ GuardError If the value does not match the assertion.
392
392
 
393
393
  ***
394
394
 
395
- ### integer()
395
+ ### integer() {#integer}
396
396
 
397
397
  > `static` **integer**(`source`, `property`, `value`): `asserts value is number`
398
398
 
@@ -428,7 +428,7 @@ GuardError If the value does not match the assertion.
428
428
 
429
429
  ***
430
430
 
431
- ### bigint()
431
+ ### bigint() {#bigint}
432
432
 
433
433
  > `static` **bigint**(`source`, `property`, `value`): `asserts value is bigint`
434
434
 
@@ -464,7 +464,7 @@ GuardError If the value does not match the assertion.
464
464
 
465
465
  ***
466
466
 
467
- ### boolean()
467
+ ### boolean() {#boolean}
468
468
 
469
469
  > `static` **boolean**(`source`, `property`, `value`): `asserts value is boolean`
470
470
 
@@ -500,7 +500,7 @@ GuardError If the value does not match the assertion.
500
500
 
501
501
  ***
502
502
 
503
- ### date()
503
+ ### date() {#date}
504
504
 
505
505
  > `static` **date**(`source`, `property`, `value`): `asserts value is Date`
506
506
 
@@ -536,7 +536,7 @@ GuardError If the value does not match the assertion.
536
536
 
537
537
  ***
538
538
 
539
- ### timestampMilliseconds()
539
+ ### timestampMilliseconds() {#timestampmilliseconds}
540
540
 
541
541
  > `static` **timestampMilliseconds**(`source`, `property`, `value`): `asserts value is number`
542
542
 
@@ -572,7 +572,7 @@ GuardError If the value does not match the assertion.
572
572
 
573
573
  ***
574
574
 
575
- ### timestampSeconds()
575
+ ### timestampSeconds() {#timestampseconds}
576
576
 
577
577
  > `static` **timestampSeconds**(`source`, `property`, `value`): `asserts value is number`
578
578
 
@@ -608,7 +608,7 @@ GuardError If the value does not match the assertion.
608
608
 
609
609
  ***
610
610
 
611
- ### object()
611
+ ### object() {#object}
612
612
 
613
613
  > `static` **object**\<`T`\>(`source`, `property`, `value`): `asserts value is T`
614
614
 
@@ -650,7 +650,7 @@ GuardError If the value does not match the assertion.
650
650
 
651
651
  ***
652
652
 
653
- ### objectValue()
653
+ ### objectValue() {#objectvalue}
654
654
 
655
655
  > `static` **objectValue**\<`T`\>(`source`, `property`, `value`): `asserts value is T`
656
656
 
@@ -692,7 +692,7 @@ GuardError If the value does not match the assertion.
692
692
 
693
693
  ***
694
694
 
695
- ### array()
695
+ ### array() {#array}
696
696
 
697
697
  > `static` **array**\<`T`\>(`source`, `property`, `value`): `asserts value is T[]`
698
698
 
@@ -734,7 +734,7 @@ GuardError If the value does not match the assertion.
734
734
 
735
735
  ***
736
736
 
737
- ### arrayValue()
737
+ ### arrayValue() {#arrayvalue}
738
738
 
739
739
  > `static` **arrayValue**\<`T`\>(`source`, `property`, `value`): `asserts value is T[]`
740
740
 
@@ -776,7 +776,7 @@ GuardError If the value does not match the assertion.
776
776
 
777
777
  ***
778
778
 
779
- ### arrayOneOf()
779
+ ### arrayOneOf() {#arrayoneof}
780
780
 
781
781
  > `static` **arrayOneOf**\<`T`\>(`source`, `property`, `value`, `options`): `asserts value is T`
782
782
 
@@ -824,7 +824,7 @@ GuardError If the value does not match the assertion.
824
824
 
825
825
  ***
826
826
 
827
- ### arrayStartsWith()
827
+ ### arrayStartsWith() {#arraystartswith}
828
828
 
829
829
  > `static` **arrayStartsWith**\<`T`\>(`source`, `property`, `value`, `startValues`): `asserts value is T[]`
830
830
 
@@ -872,7 +872,7 @@ GuardError If the value does not match the assertion.
872
872
 
873
873
  ***
874
874
 
875
- ### arrayEndsWith()
875
+ ### arrayEndsWith() {#arrayendswith}
876
876
 
877
877
  > `static` **arrayEndsWith**\<`T`\>(`source`, `property`, `value`, `endValues`): `asserts value is T[]`
878
878
 
@@ -920,7 +920,7 @@ GuardError If the value does not match the assertion.
920
920
 
921
921
  ***
922
922
 
923
- ### uint8Array()
923
+ ### uint8Array() {#uint8array}
924
924
 
925
925
  > `static` **uint8Array**(`source`, `property`, `value`): `asserts value is Uint8Array<ArrayBufferLike>`
926
926
 
@@ -956,7 +956,7 @@ GuardError If the value does not match the assertion.
956
956
 
957
957
  ***
958
958
 
959
- ### function()
959
+ ### function() {#function}
960
960
 
961
961
  > `static` **function**\<`T`\>(`source`, `property`, `value`): `asserts value is T`
962
962
 
@@ -998,7 +998,7 @@ GuardError If the value does not match the assertion.
998
998
 
999
999
  ***
1000
1000
 
1001
- ### email()
1001
+ ### email() {#email}
1002
1002
 
1003
1003
  > `static` **email**(`source`, `property`, `value`): `asserts value is string`
1004
1004
 
@@ -1034,7 +1034,7 @@ GuardError If the value does not match the assertion.
1034
1034
 
1035
1035
  ***
1036
1036
 
1037
- ### uuidV7()
1037
+ ### uuidV7() {#uuidv7}
1038
1038
 
1039
1039
  > `static` **uuidV7**(`source`, `property`, `value`, `format?`): `asserts value is string`
1040
1040
 
@@ -14,7 +14,7 @@ Helper methods for hex conversions.
14
14
 
15
15
  ## Methods
16
16
 
17
- ### stripPrefix()
17
+ ### stripPrefix() {#stripprefix}
18
18
 
19
19
  > `static` **stripPrefix**(`hex`): `string`
20
20
 
@@ -36,7 +36,7 @@ The stripped hex without the prefix.
36
36
 
37
37
  ***
38
38
 
39
- ### addPrefix()
39
+ ### addPrefix() {#addprefix}
40
40
 
41
41
  > `static` **addPrefix**(`hex`): `string`
42
42
 
@@ -58,7 +58,7 @@ The hex with the prefix.
58
58
 
59
59
  ***
60
60
 
61
- ### hasPrefix()
61
+ ### hasPrefix() {#hasprefix}
62
62
 
63
63
  > `static` **hasPrefix**(`hex`): `boolean`
64
64
 
@@ -80,9 +80,9 @@ True if the hex string has the prefix.
80
80
 
81
81
  ***
82
82
 
83
- ### isHex()
83
+ ### isHex() {#ishex}
84
84
 
85
- > `static` **isHex**(`value`, `allowPrefix`): `boolean`
85
+ > `static` **isHex**(`value`, `allowPrefix?`): `boolean`
86
86
 
87
87
  Is the data hex format.
88
88
 
@@ -94,7 +94,7 @@ Is the data hex format.
94
94
 
95
95
  The value to test.
96
96
 
97
- ##### allowPrefix
97
+ ##### allowPrefix?
98
98
 
99
99
  `boolean` = `false`
100
100
 
@@ -14,7 +14,7 @@ Class to perform internationalization.
14
14
 
15
15
  ## Properties
16
16
 
17
- ### DEFAULT\_LOCALE
17
+ ### DEFAULT\_LOCALE {#default_locale}
18
18
 
19
19
  > `static` **DEFAULT\_LOCALE**: `string` = `"en"`
20
20
 
@@ -22,7 +22,7 @@ The default translation.
22
22
 
23
23
  ## Methods
24
24
 
25
- ### setLocale()
25
+ ### setLocale() {#setlocale}
26
26
 
27
27
  > `static` **setLocale**(`locale`): `void`
28
28
 
@@ -42,7 +42,7 @@ The new locale.
42
42
 
43
43
  ***
44
44
 
45
- ### getLocale()
45
+ ### getLocale() {#getlocale}
46
46
 
47
47
  > `static` **getLocale**(): `string`
48
48
 
@@ -56,7 +56,7 @@ The current locale.
56
56
 
57
57
  ***
58
58
 
59
- ### addDictionary()
59
+ ### addDictionary() {#adddictionary}
60
60
 
61
61
  > `static` **addDictionary**(`locale`, `dictionary`): `void`
62
62
 
@@ -82,7 +82,7 @@ The dictionary to add.
82
82
 
83
83
  ***
84
84
 
85
- ### getDictionary()
85
+ ### getDictionary() {#getdictionary}
86
86
 
87
87
  > `static` **getDictionary**(`locale`): \{\[`key`: `string`\]: `string`; \} \| `undefined`
88
88
 
@@ -104,7 +104,7 @@ The dictionary of undefined if it does not exist.
104
104
 
105
105
  ***
106
106
 
107
- ### getAllDictionaries()
107
+ ### getAllDictionaries() {#getalldictionaries}
108
108
 
109
109
  > `static` **getAllDictionaries**(): `object`
110
110
 
@@ -118,7 +118,7 @@ The dictionaries.
118
118
 
119
119
  ***
120
120
 
121
- ### addLocaleHandler()
121
+ ### addLocaleHandler() {#addlocalehandler}
122
122
 
123
123
  > `static` **addLocaleHandler**(`id`, `handler`): `void`
124
124
 
@@ -144,7 +144,7 @@ The handler to add.
144
144
 
145
145
  ***
146
146
 
147
- ### removeLocaleHandler()
147
+ ### removeLocaleHandler() {#removelocalehandler}
148
148
 
149
149
  > `static` **removeLocaleHandler**(`id`): `void`
150
150
 
@@ -164,7 +164,7 @@ The id of the handler.
164
164
 
165
165
  ***
166
166
 
167
- ### addDictionaryHandler()
167
+ ### addDictionaryHandler() {#adddictionaryhandler}
168
168
 
169
169
  > `static` **addDictionaryHandler**(`id`, `handler`): `void`
170
170
 
@@ -190,7 +190,7 @@ The handler to add.
190
190
 
191
191
  ***
192
192
 
193
- ### removeDictionaryHandler()
193
+ ### removeDictionaryHandler() {#removedictionaryhandler}
194
194
 
195
195
  > `static` **removeDictionaryHandler**(`id`): `void`
196
196
 
@@ -210,7 +210,7 @@ The id of the handler.
210
210
 
211
211
  ***
212
212
 
213
- ### formatMessage()
213
+ ### formatMessage() {#formatmessage}
214
214
 
215
215
  > `static` **formatMessage**(`key`, `values?`, `overrideLocale?`): `string`
216
216
 
@@ -242,7 +242,7 @@ The formatted string.
242
242
 
243
243
  ***
244
244
 
245
- ### hasMessage()
245
+ ### hasMessage() {#hasmessage}
246
246
 
247
247
  > `static` **hasMessage**(`key`): `boolean`
248
248
 
@@ -264,7 +264,7 @@ True if the key exists.
264
264
 
265
265
  ***
266
266
 
267
- ### flattenTranslationKeys()
267
+ ### flattenTranslationKeys() {#flattentranslationkeys}
268
268
 
269
269
  > `static` **flattenTranslationKeys**(`translation`, `propertyPath`, `mergedKeys`): `void`
270
270
 
@@ -294,7 +294,7 @@ The merged keys dictionary to populate.
294
294
 
295
295
  ***
296
296
 
297
- ### getPropertyNames()
297
+ ### getPropertyNames() {#getpropertynames}
298
298
 
299
299
  > `static` **getPropertyNames**(`message`): `string`[]
300
300