@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
|
@@ -14,9 +14,9 @@ Coerce an object from one type to another.
|
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
|
-
### string()
|
|
17
|
+
### string() {#string}
|
|
18
18
|
|
|
19
|
-
> `static` **string**(`value`): `
|
|
19
|
+
> `static` **string**(`value`): `string` \| `undefined`
|
|
20
20
|
|
|
21
21
|
Coerce the value to a string.
|
|
22
22
|
|
|
@@ -30,7 +30,7 @@ The value to coerce.
|
|
|
30
30
|
|
|
31
31
|
#### Returns
|
|
32
32
|
|
|
33
|
-
`
|
|
33
|
+
`string` \| `undefined`
|
|
34
34
|
|
|
35
35
|
The value if it can be coerced.
|
|
36
36
|
|
|
@@ -40,9 +40,9 @@ TypeError If the value can not be coerced.
|
|
|
40
40
|
|
|
41
41
|
***
|
|
42
42
|
|
|
43
|
-
### number()
|
|
43
|
+
### number() {#number}
|
|
44
44
|
|
|
45
|
-
> `static` **number**(`value`): `
|
|
45
|
+
> `static` **number**(`value`): `number` \| `undefined`
|
|
46
46
|
|
|
47
47
|
Coerce the value to a number.
|
|
48
48
|
|
|
@@ -56,7 +56,7 @@ The value to coerce.
|
|
|
56
56
|
|
|
57
57
|
#### Returns
|
|
58
58
|
|
|
59
|
-
`
|
|
59
|
+
`number` \| `undefined`
|
|
60
60
|
|
|
61
61
|
The value if it can be coerced.
|
|
62
62
|
|
|
@@ -66,9 +66,9 @@ TypeError If the value can not be coerced.
|
|
|
66
66
|
|
|
67
67
|
***
|
|
68
68
|
|
|
69
|
-
### integer()
|
|
69
|
+
### integer() {#integer}
|
|
70
70
|
|
|
71
|
-
> `static` **integer**(`value`): `
|
|
71
|
+
> `static` **integer**(`value`): `number` \| `undefined`
|
|
72
72
|
|
|
73
73
|
Coerce the value to an integer.
|
|
74
74
|
|
|
@@ -82,7 +82,7 @@ The value to coerce.
|
|
|
82
82
|
|
|
83
83
|
#### Returns
|
|
84
84
|
|
|
85
|
-
`
|
|
85
|
+
`number` \| `undefined`
|
|
86
86
|
|
|
87
87
|
The value if it can be coerced.
|
|
88
88
|
|
|
@@ -92,9 +92,9 @@ TypeError If the value can not be coerced.
|
|
|
92
92
|
|
|
93
93
|
***
|
|
94
94
|
|
|
95
|
-
### bigint()
|
|
95
|
+
### bigint() {#bigint}
|
|
96
96
|
|
|
97
|
-
> `static` **bigint**(`value`): `
|
|
97
|
+
> `static` **bigint**(`value`): `bigint` \| `undefined`
|
|
98
98
|
|
|
99
99
|
Coerce the value to a bigint.
|
|
100
100
|
|
|
@@ -108,7 +108,7 @@ The value to coerce.
|
|
|
108
108
|
|
|
109
109
|
#### Returns
|
|
110
110
|
|
|
111
|
-
`
|
|
111
|
+
`bigint` \| `undefined`
|
|
112
112
|
|
|
113
113
|
The value if it can be coerced.
|
|
114
114
|
|
|
@@ -118,9 +118,9 @@ TypeError If the value can not be coerced.
|
|
|
118
118
|
|
|
119
119
|
***
|
|
120
120
|
|
|
121
|
-
### boolean()
|
|
121
|
+
### boolean() {#boolean}
|
|
122
122
|
|
|
123
|
-
> `static` **boolean**(`value`): `
|
|
123
|
+
> `static` **boolean**(`value`): `boolean` \| `undefined`
|
|
124
124
|
|
|
125
125
|
Coerce the value to a boolean.
|
|
126
126
|
|
|
@@ -134,7 +134,7 @@ The value to coerce.
|
|
|
134
134
|
|
|
135
135
|
#### Returns
|
|
136
136
|
|
|
137
|
-
`
|
|
137
|
+
`boolean` \| `undefined`
|
|
138
138
|
|
|
139
139
|
The value if it can be coerced.
|
|
140
140
|
|
|
@@ -144,9 +144,9 @@ TypeError If the value can not be coerced.
|
|
|
144
144
|
|
|
145
145
|
***
|
|
146
146
|
|
|
147
|
-
### date()
|
|
147
|
+
### date() {#date}
|
|
148
148
|
|
|
149
|
-
> `static` **date**(`value`): `
|
|
149
|
+
> `static` **date**(`value`): `Date` \| `undefined`
|
|
150
150
|
|
|
151
151
|
Coerce the value to a date.
|
|
152
152
|
|
|
@@ -160,7 +160,7 @@ The value to coerce.
|
|
|
160
160
|
|
|
161
161
|
#### Returns
|
|
162
162
|
|
|
163
|
-
`
|
|
163
|
+
`Date` \| `undefined`
|
|
164
164
|
|
|
165
165
|
The value if it can be coerced.
|
|
166
166
|
|
|
@@ -170,9 +170,9 @@ TypeError If the value can not be coerced.
|
|
|
170
170
|
|
|
171
171
|
***
|
|
172
172
|
|
|
173
|
-
### dateTime()
|
|
173
|
+
### dateTime() {#datetime}
|
|
174
174
|
|
|
175
|
-
> `static` **dateTime**(`value`): `
|
|
175
|
+
> `static` **dateTime**(`value`): `Date` \| `undefined`
|
|
176
176
|
|
|
177
177
|
Coerce the value to a date/time.
|
|
178
178
|
|
|
@@ -186,7 +186,7 @@ The value to coerce.
|
|
|
186
186
|
|
|
187
187
|
#### Returns
|
|
188
188
|
|
|
189
|
-
`
|
|
189
|
+
`Date` \| `undefined`
|
|
190
190
|
|
|
191
191
|
The value if it can be coerced.
|
|
192
192
|
|
|
@@ -196,9 +196,9 @@ TypeError If the value can not be coerced.
|
|
|
196
196
|
|
|
197
197
|
***
|
|
198
198
|
|
|
199
|
-
### time()
|
|
199
|
+
### time() {#time}
|
|
200
200
|
|
|
201
|
-
> `static` **time**(`value`): `
|
|
201
|
+
> `static` **time**(`value`): `Date` \| `undefined`
|
|
202
202
|
|
|
203
203
|
Coerce the value to a time.
|
|
204
204
|
|
|
@@ -212,7 +212,7 @@ The value to coerce.
|
|
|
212
212
|
|
|
213
213
|
#### Returns
|
|
214
214
|
|
|
215
|
-
`
|
|
215
|
+
`Date` \| `undefined`
|
|
216
216
|
|
|
217
217
|
The value if it can be coerced.
|
|
218
218
|
|
|
@@ -222,9 +222,9 @@ TypeError If the value can not be coerced.
|
|
|
222
222
|
|
|
223
223
|
***
|
|
224
224
|
|
|
225
|
-
### object()
|
|
225
|
+
### object() {#object}
|
|
226
226
|
|
|
227
|
-
> `static` **object**\<`T`\>(`value`): `
|
|
227
|
+
> `static` **object**\<`T`\>(`value`): `T` \| `undefined`
|
|
228
228
|
|
|
229
229
|
Coerce the value to an object.
|
|
230
230
|
|
|
@@ -244,7 +244,7 @@ The value to coerce.
|
|
|
244
244
|
|
|
245
245
|
#### Returns
|
|
246
246
|
|
|
247
|
-
`
|
|
247
|
+
`T` \| `undefined`
|
|
248
248
|
|
|
249
249
|
The value if it can be coerced.
|
|
250
250
|
|
|
@@ -254,9 +254,9 @@ TypeError If the value can not be coerced.
|
|
|
254
254
|
|
|
255
255
|
***
|
|
256
256
|
|
|
257
|
-
### uint8Array()
|
|
257
|
+
### uint8Array() {#uint8array}
|
|
258
258
|
|
|
259
|
-
> `static` **uint8Array**(`value`): `
|
|
259
|
+
> `static` **uint8Array**(`value`): `Uint8Array`\<`ArrayBufferLike`\> \| `undefined`
|
|
260
260
|
|
|
261
261
|
Coerce the value to a Uint8Array.
|
|
262
262
|
|
|
@@ -270,7 +270,7 @@ The value to coerce.
|
|
|
270
270
|
|
|
271
271
|
#### Returns
|
|
272
272
|
|
|
273
|
-
`
|
|
273
|
+
`Uint8Array`\<`ArrayBufferLike`\> \| `undefined`
|
|
274
274
|
|
|
275
275
|
The value if it can be coerced.
|
|
276
276
|
|
|
@@ -280,7 +280,7 @@ TypeError If the value can not be coerced.
|
|
|
280
280
|
|
|
281
281
|
***
|
|
282
282
|
|
|
283
|
-
### byType()
|
|
283
|
+
### byType() {#bytype}
|
|
284
284
|
|
|
285
285
|
> `static` **byType**(`value`, `type?`): `unknown`
|
|
286
286
|
|
|
@@ -12,9 +12,17 @@ A class to handle compression.
|
|
|
12
12
|
|
|
13
13
|
`Compression`
|
|
14
14
|
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME {#class_name}
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
15
23
|
## Methods
|
|
16
24
|
|
|
17
|
-
### compress()
|
|
25
|
+
### compress() {#compress}
|
|
18
26
|
|
|
19
27
|
> `static` **compress**(`bytes`, `type`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
20
28
|
|
|
@@ -42,7 +50,7 @@ The compressed bytes.
|
|
|
42
50
|
|
|
43
51
|
***
|
|
44
52
|
|
|
45
|
-
### decompress()
|
|
53
|
+
### decompress() {#decompress}
|
|
46
54
|
|
|
47
55
|
> `static` **decompress**(`compressedBytes`, `type`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
48
56
|
|
|
@@ -10,7 +10,7 @@ Class to handle errors which are triggered by conflicting data.
|
|
|
10
10
|
|
|
11
11
|
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new ConflictError**(`source`, `message`, `conflictId?`, `conflicts?`, `cause?`): `ConflictError`
|
|
13
|
+
> **new ConflictError**(`source`, `message`, `conflictId?`, `conflicts?`, `properties?`, `cause?`): `ConflictError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of ConflictError.
|
|
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
|
##### conflictId?
|
|
32
32
|
|
|
@@ -40,6 +40,10 @@ The id that has conflicts.
|
|
|
40
40
|
|
|
41
41
|
The conflicts that occurred.
|
|
42
42
|
|
|
43
|
+
##### properties?
|
|
44
|
+
|
|
45
|
+
Any additional information for the error.
|
|
46
|
+
|
|
43
47
|
##### cause?
|
|
44
48
|
|
|
45
49
|
`unknown`
|
|
@@ -56,9 +60,9 @@ The cause or the error if we have wrapped another error.
|
|
|
56
60
|
|
|
57
61
|
## Properties
|
|
58
62
|
|
|
59
|
-
### source?
|
|
63
|
+
### source? {#source}
|
|
60
64
|
|
|
61
|
-
> `optional` **source
|
|
65
|
+
> `optional` **source?**: `string`
|
|
62
66
|
|
|
63
67
|
The source of the error.
|
|
64
68
|
|
|
@@ -68,9 +72,9 @@ The source of the error.
|
|
|
68
72
|
|
|
69
73
|
***
|
|
70
74
|
|
|
71
|
-
### properties?
|
|
75
|
+
### properties? {#properties}
|
|
72
76
|
|
|
73
|
-
> `optional` **properties
|
|
77
|
+
> `optional` **properties?**: `object`
|
|
74
78
|
|
|
75
79
|
Any additional information for the error.
|
|
76
80
|
|
|
@@ -84,9 +88,9 @@ Any additional information for the error.
|
|
|
84
88
|
|
|
85
89
|
***
|
|
86
90
|
|
|
87
|
-
### cause?
|
|
91
|
+
### cause? {#cause}
|
|
88
92
|
|
|
89
|
-
> `optional` **cause
|
|
93
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
90
94
|
|
|
91
95
|
The cause of the error.
|
|
92
96
|
|
|
@@ -96,7 +100,7 @@ The cause of the error.
|
|
|
96
100
|
|
|
97
101
|
***
|
|
98
102
|
|
|
99
|
-
### CLASS\_NAME
|
|
103
|
+
### CLASS\_NAME {#class_name}
|
|
100
104
|
|
|
101
105
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
102
106
|
|
|
@@ -104,7 +108,7 @@ Runtime name for the class.
|
|
|
104
108
|
|
|
105
109
|
## Methods
|
|
106
110
|
|
|
107
|
-
### fromError()
|
|
111
|
+
### fromError() {#fromerror}
|
|
108
112
|
|
|
109
113
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
110
114
|
|
|
@@ -130,7 +134,7 @@ The new instance.
|
|
|
130
134
|
|
|
131
135
|
***
|
|
132
136
|
|
|
133
|
-
### flatten()
|
|
137
|
+
### flatten() {#flatten}
|
|
134
138
|
|
|
135
139
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
136
140
|
|
|
@@ -156,9 +160,9 @@ The list of all internal errors.
|
|
|
156
160
|
|
|
157
161
|
***
|
|
158
162
|
|
|
159
|
-
### expand()
|
|
163
|
+
### expand() {#expand}
|
|
160
164
|
|
|
161
|
-
> `static` **expand**(`errors`):
|
|
165
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
162
166
|
|
|
163
167
|
Expand an error tree.
|
|
164
168
|
|
|
@@ -166,13 +170,13 @@ Expand an error tree.
|
|
|
166
170
|
|
|
167
171
|
##### errors
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
170
174
|
|
|
171
|
-
|
|
175
|
+
The list of errors to expand.
|
|
172
176
|
|
|
173
177
|
#### Returns
|
|
174
178
|
|
|
175
|
-
|
|
179
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
176
180
|
|
|
177
181
|
The first level error.
|
|
178
182
|
|
|
@@ -182,7 +186,7 @@ The first level error.
|
|
|
182
186
|
|
|
183
187
|
***
|
|
184
188
|
|
|
185
|
-
### isErrorName()
|
|
189
|
+
### isErrorName() {#iserrorname}
|
|
186
190
|
|
|
187
191
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
188
192
|
|
|
@@ -198,9 +202,9 @@ The error to test.
|
|
|
198
202
|
|
|
199
203
|
##### name
|
|
200
204
|
|
|
201
|
-
|
|
205
|
+
`string` \| `RegExp`
|
|
202
206
|
|
|
203
|
-
|
|
207
|
+
The name to check for.
|
|
204
208
|
|
|
205
209
|
#### Returns
|
|
206
210
|
|
|
@@ -214,7 +218,7 @@ True if the error has the name.
|
|
|
214
218
|
|
|
215
219
|
***
|
|
216
220
|
|
|
217
|
-
### isErrorMessage()
|
|
221
|
+
### isErrorMessage() {#iserrormessage}
|
|
218
222
|
|
|
219
223
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
220
224
|
|
|
@@ -230,9 +234,9 @@ The error to test.
|
|
|
230
234
|
|
|
231
235
|
##### message
|
|
232
236
|
|
|
233
|
-
|
|
237
|
+
`string` \| `RegExp`
|
|
234
238
|
|
|
235
|
-
|
|
239
|
+
The message to check for.
|
|
236
240
|
|
|
237
241
|
#### Returns
|
|
238
242
|
|
|
@@ -246,7 +250,7 @@ True if the error has the name.
|
|
|
246
250
|
|
|
247
251
|
***
|
|
248
252
|
|
|
249
|
-
### isErrorCode()
|
|
253
|
+
### isErrorCode() {#iserrorcode}
|
|
250
254
|
|
|
251
255
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
252
256
|
|
|
@@ -262,9 +266,9 @@ The error to test.
|
|
|
262
266
|
|
|
263
267
|
##### code
|
|
264
268
|
|
|
265
|
-
|
|
269
|
+
`string` \| `RegExp`
|
|
266
270
|
|
|
267
|
-
|
|
271
|
+
The code to check for.
|
|
268
272
|
|
|
269
273
|
#### Returns
|
|
270
274
|
|
|
@@ -278,7 +282,7 @@ True if the error has the code.
|
|
|
278
282
|
|
|
279
283
|
***
|
|
280
284
|
|
|
281
|
-
### someErrorName()
|
|
285
|
+
### someErrorName() {#someerrorname}
|
|
282
286
|
|
|
283
287
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
284
288
|
|
|
@@ -294,9 +298,9 @@ The error to test.
|
|
|
294
298
|
|
|
295
299
|
##### name
|
|
296
300
|
|
|
297
|
-
|
|
301
|
+
`string` \| `RegExp`
|
|
298
302
|
|
|
299
|
-
|
|
303
|
+
The name to check for.
|
|
300
304
|
|
|
301
305
|
#### Returns
|
|
302
306
|
|
|
@@ -310,7 +314,7 @@ True if the error has the name.
|
|
|
310
314
|
|
|
311
315
|
***
|
|
312
316
|
|
|
313
|
-
### someErrorMessage()
|
|
317
|
+
### someErrorMessage() {#someerrormessage}
|
|
314
318
|
|
|
315
319
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
316
320
|
|
|
@@ -326,9 +330,9 @@ The error to test.
|
|
|
326
330
|
|
|
327
331
|
##### message
|
|
328
332
|
|
|
329
|
-
|
|
333
|
+
`string` \| `RegExp`
|
|
330
334
|
|
|
331
|
-
|
|
335
|
+
The message to check for.
|
|
332
336
|
|
|
333
337
|
#### Returns
|
|
334
338
|
|
|
@@ -342,7 +346,7 @@ True if the error has the name.
|
|
|
342
346
|
|
|
343
347
|
***
|
|
344
348
|
|
|
345
|
-
### someErrorClass()
|
|
349
|
+
### someErrorClass() {#someerrorclass}
|
|
346
350
|
|
|
347
351
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
348
352
|
|
|
@@ -374,7 +378,7 @@ True if the error has the specific class.
|
|
|
374
378
|
|
|
375
379
|
***
|
|
376
380
|
|
|
377
|
-
### someErrorCode()
|
|
381
|
+
### someErrorCode() {#someerrorcode}
|
|
378
382
|
|
|
379
383
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
380
384
|
|
|
@@ -390,9 +394,9 @@ The error to test.
|
|
|
390
394
|
|
|
391
395
|
##### code
|
|
392
396
|
|
|
393
|
-
|
|
397
|
+
`string` \| `RegExp`
|
|
394
398
|
|
|
395
|
-
|
|
399
|
+
The code to check for.
|
|
396
400
|
|
|
397
401
|
#### Returns
|
|
398
402
|
|
|
@@ -406,7 +410,7 @@ True if the error has the name.
|
|
|
406
410
|
|
|
407
411
|
***
|
|
408
412
|
|
|
409
|
-
### isEmpty()
|
|
413
|
+
### isEmpty() {#isempty}
|
|
410
414
|
|
|
411
415
|
> `static` **isEmpty**(`err`): `boolean`
|
|
412
416
|
|
|
@@ -432,7 +436,7 @@ True if the error is empty.
|
|
|
432
436
|
|
|
433
437
|
***
|
|
434
438
|
|
|
435
|
-
### isAggregateError()
|
|
439
|
+
### isAggregateError() {#isaggregateerror}
|
|
436
440
|
|
|
437
441
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
438
442
|
|
|
@@ -458,7 +462,7 @@ True if the error is an aggregate error.
|
|
|
458
462
|
|
|
459
463
|
***
|
|
460
464
|
|
|
461
|
-
### fromAggregate()
|
|
465
|
+
### fromAggregate() {#fromaggregate}
|
|
462
466
|
|
|
463
467
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
464
468
|
|
|
@@ -490,7 +494,7 @@ The array of errors.
|
|
|
490
494
|
|
|
491
495
|
***
|
|
492
496
|
|
|
493
|
-
### toJsonObject()
|
|
497
|
+
### toJsonObject() {#tojsonobject}
|
|
494
498
|
|
|
495
499
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
496
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
|
|
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
|
|
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 @@ 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,9 +64,9 @@ The localized version of the errors flattened.
|
|
|
64
64
|
|
|
65
65
|
***
|
|
66
66
|
|
|
67
|
-
### formatValidationErrors()
|
|
67
|
+
### formatValidationErrors() {#formatvalidationerrors}
|
|
68
68
|
|
|
69
|
-
> `static` **formatValidationErrors**(`error`): `
|
|
69
|
+
> `static` **formatValidationErrors**(`error`): `string` \| `undefined`
|
|
70
70
|
|
|
71
71
|
Localize the content of an error and any causes.
|
|
72
72
|
|
|
@@ -80,6 +80,6 @@ The error to format.
|
|
|
80
80
|
|
|
81
81
|
#### Returns
|
|
82
82
|
|
|
83
|
-
`
|
|
83
|
+
`string` \| `undefined`
|
|
84
84
|
|
|
85
85
|
The localized version of the errors flattened.
|