@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
|
@@ -10,7 +10,7 @@ Class to handle errors when a feature is unsupported.
|
|
|
10
10
|
|
|
11
11
|
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new NotSupportedError**(`source`, `message`, `cause?`): `NotSupportedError`
|
|
13
|
+
> **new NotSupportedError**(`source`, `message`, `properties?`, `cause?`): `NotSupportedError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of NotSupportedError.
|
|
16
16
|
|
|
@@ -26,7 +26,11 @@ The source of the error.
|
|
|
26
26
|
|
|
27
27
|
`string`
|
|
28
28
|
|
|
29
|
-
The message as
|
|
29
|
+
The message as an i18n key.
|
|
30
|
+
|
|
31
|
+
##### properties?
|
|
32
|
+
|
|
33
|
+
Any additional information for the error.
|
|
30
34
|
|
|
31
35
|
##### cause?
|
|
32
36
|
|
|
@@ -44,9 +48,9 @@ The cause of the error if we have wrapped another error.
|
|
|
44
48
|
|
|
45
49
|
## Properties
|
|
46
50
|
|
|
47
|
-
### source?
|
|
51
|
+
### source? {#source}
|
|
48
52
|
|
|
49
|
-
> `optional` **source
|
|
53
|
+
> `optional` **source?**: `string`
|
|
50
54
|
|
|
51
55
|
The source of the error.
|
|
52
56
|
|
|
@@ -56,9 +60,9 @@ The source of the error.
|
|
|
56
60
|
|
|
57
61
|
***
|
|
58
62
|
|
|
59
|
-
### properties?
|
|
63
|
+
### properties? {#properties}
|
|
60
64
|
|
|
61
|
-
> `optional` **properties
|
|
65
|
+
> `optional` **properties?**: `object`
|
|
62
66
|
|
|
63
67
|
Any additional information for the error.
|
|
64
68
|
|
|
@@ -72,9 +76,9 @@ Any additional information for the error.
|
|
|
72
76
|
|
|
73
77
|
***
|
|
74
78
|
|
|
75
|
-
### cause?
|
|
79
|
+
### cause? {#cause}
|
|
76
80
|
|
|
77
|
-
> `optional` **cause
|
|
81
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
78
82
|
|
|
79
83
|
The cause of the error.
|
|
80
84
|
|
|
@@ -84,7 +88,7 @@ The cause of the error.
|
|
|
84
88
|
|
|
85
89
|
***
|
|
86
90
|
|
|
87
|
-
### CLASS\_NAME
|
|
91
|
+
### CLASS\_NAME {#class_name}
|
|
88
92
|
|
|
89
93
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
90
94
|
|
|
@@ -92,7 +96,7 @@ Runtime name for the class.
|
|
|
92
96
|
|
|
93
97
|
## Methods
|
|
94
98
|
|
|
95
|
-
### fromError()
|
|
99
|
+
### fromError() {#fromerror}
|
|
96
100
|
|
|
97
101
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
98
102
|
|
|
@@ -118,7 +122,7 @@ The new instance.
|
|
|
118
122
|
|
|
119
123
|
***
|
|
120
124
|
|
|
121
|
-
### flatten()
|
|
125
|
+
### flatten() {#flatten}
|
|
122
126
|
|
|
123
127
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
124
128
|
|
|
@@ -144,9 +148,9 @@ The list of all internal errors.
|
|
|
144
148
|
|
|
145
149
|
***
|
|
146
150
|
|
|
147
|
-
### expand()
|
|
151
|
+
### expand() {#expand}
|
|
148
152
|
|
|
149
|
-
> `static` **expand**(`errors`):
|
|
153
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
150
154
|
|
|
151
155
|
Expand an error tree.
|
|
152
156
|
|
|
@@ -154,13 +158,13 @@ Expand an error tree.
|
|
|
154
158
|
|
|
155
159
|
##### errors
|
|
156
160
|
|
|
157
|
-
|
|
161
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
158
162
|
|
|
159
|
-
|
|
163
|
+
The list of errors to expand.
|
|
160
164
|
|
|
161
165
|
#### Returns
|
|
162
166
|
|
|
163
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
164
168
|
|
|
165
169
|
The first level error.
|
|
166
170
|
|
|
@@ -170,7 +174,7 @@ The first level error.
|
|
|
170
174
|
|
|
171
175
|
***
|
|
172
176
|
|
|
173
|
-
### isErrorName()
|
|
177
|
+
### isErrorName() {#iserrorname}
|
|
174
178
|
|
|
175
179
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
176
180
|
|
|
@@ -186,9 +190,9 @@ The error to test.
|
|
|
186
190
|
|
|
187
191
|
##### name
|
|
188
192
|
|
|
189
|
-
|
|
193
|
+
`string` \| `RegExp`
|
|
190
194
|
|
|
191
|
-
|
|
195
|
+
The name to check for.
|
|
192
196
|
|
|
193
197
|
#### Returns
|
|
194
198
|
|
|
@@ -202,7 +206,7 @@ True if the error has the name.
|
|
|
202
206
|
|
|
203
207
|
***
|
|
204
208
|
|
|
205
|
-
### isErrorMessage()
|
|
209
|
+
### isErrorMessage() {#iserrormessage}
|
|
206
210
|
|
|
207
211
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
208
212
|
|
|
@@ -218,9 +222,9 @@ The error to test.
|
|
|
218
222
|
|
|
219
223
|
##### message
|
|
220
224
|
|
|
221
|
-
|
|
225
|
+
`string` \| `RegExp`
|
|
222
226
|
|
|
223
|
-
|
|
227
|
+
The message to check for.
|
|
224
228
|
|
|
225
229
|
#### Returns
|
|
226
230
|
|
|
@@ -234,7 +238,7 @@ True if the error has the name.
|
|
|
234
238
|
|
|
235
239
|
***
|
|
236
240
|
|
|
237
|
-
### isErrorCode()
|
|
241
|
+
### isErrorCode() {#iserrorcode}
|
|
238
242
|
|
|
239
243
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
240
244
|
|
|
@@ -250,9 +254,9 @@ The error to test.
|
|
|
250
254
|
|
|
251
255
|
##### code
|
|
252
256
|
|
|
253
|
-
|
|
257
|
+
`string` \| `RegExp`
|
|
254
258
|
|
|
255
|
-
|
|
259
|
+
The code to check for.
|
|
256
260
|
|
|
257
261
|
#### Returns
|
|
258
262
|
|
|
@@ -266,7 +270,7 @@ True if the error has the code.
|
|
|
266
270
|
|
|
267
271
|
***
|
|
268
272
|
|
|
269
|
-
### someErrorName()
|
|
273
|
+
### someErrorName() {#someerrorname}
|
|
270
274
|
|
|
271
275
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
272
276
|
|
|
@@ -282,9 +286,9 @@ The error to test.
|
|
|
282
286
|
|
|
283
287
|
##### name
|
|
284
288
|
|
|
285
|
-
|
|
289
|
+
`string` \| `RegExp`
|
|
286
290
|
|
|
287
|
-
|
|
291
|
+
The name to check for.
|
|
288
292
|
|
|
289
293
|
#### Returns
|
|
290
294
|
|
|
@@ -298,7 +302,7 @@ True if the error has the name.
|
|
|
298
302
|
|
|
299
303
|
***
|
|
300
304
|
|
|
301
|
-
### someErrorMessage()
|
|
305
|
+
### someErrorMessage() {#someerrormessage}
|
|
302
306
|
|
|
303
307
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
304
308
|
|
|
@@ -314,9 +318,9 @@ The error to test.
|
|
|
314
318
|
|
|
315
319
|
##### message
|
|
316
320
|
|
|
317
|
-
|
|
321
|
+
`string` \| `RegExp`
|
|
318
322
|
|
|
319
|
-
|
|
323
|
+
The message to check for.
|
|
320
324
|
|
|
321
325
|
#### Returns
|
|
322
326
|
|
|
@@ -330,7 +334,7 @@ True if the error has the name.
|
|
|
330
334
|
|
|
331
335
|
***
|
|
332
336
|
|
|
333
|
-
### someErrorClass()
|
|
337
|
+
### someErrorClass() {#someerrorclass}
|
|
334
338
|
|
|
335
339
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
336
340
|
|
|
@@ -362,7 +366,7 @@ True if the error has the specific class.
|
|
|
362
366
|
|
|
363
367
|
***
|
|
364
368
|
|
|
365
|
-
### someErrorCode()
|
|
369
|
+
### someErrorCode() {#someerrorcode}
|
|
366
370
|
|
|
367
371
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
368
372
|
|
|
@@ -378,9 +382,9 @@ The error to test.
|
|
|
378
382
|
|
|
379
383
|
##### code
|
|
380
384
|
|
|
381
|
-
|
|
385
|
+
`string` \| `RegExp`
|
|
382
386
|
|
|
383
|
-
|
|
387
|
+
The code to check for.
|
|
384
388
|
|
|
385
389
|
#### Returns
|
|
386
390
|
|
|
@@ -394,7 +398,7 @@ True if the error has the name.
|
|
|
394
398
|
|
|
395
399
|
***
|
|
396
400
|
|
|
397
|
-
### isEmpty()
|
|
401
|
+
### isEmpty() {#isempty}
|
|
398
402
|
|
|
399
403
|
> `static` **isEmpty**(`err`): `boolean`
|
|
400
404
|
|
|
@@ -420,7 +424,7 @@ True if the error is empty.
|
|
|
420
424
|
|
|
421
425
|
***
|
|
422
426
|
|
|
423
|
-
### isAggregateError()
|
|
427
|
+
### isAggregateError() {#isaggregateerror}
|
|
424
428
|
|
|
425
429
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
426
430
|
|
|
@@ -446,7 +450,7 @@ True if the error is an aggregate error.
|
|
|
446
450
|
|
|
447
451
|
***
|
|
448
452
|
|
|
449
|
-
### fromAggregate()
|
|
453
|
+
### fromAggregate() {#fromaggregate}
|
|
450
454
|
|
|
451
455
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
452
456
|
|
|
@@ -478,7 +482,7 @@ The array of errors.
|
|
|
478
482
|
|
|
479
483
|
***
|
|
480
484
|
|
|
481
|
-
### toJsonObject()
|
|
485
|
+
### toJsonObject() {#tojsonobject}
|
|
482
486
|
|
|
483
487
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
484
488
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# Class: NumberHelper
|
|
2
|
+
|
|
3
|
+
Class to help with numbers.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### Constructor
|
|
8
|
+
|
|
9
|
+
> **new NumberHelper**(): `NumberHelper`
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
`NumberHelper`
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### CLASS\_NAME {#class_name}
|
|
18
|
+
|
|
19
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
20
|
+
|
|
21
|
+
Runtime name for the class.
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### clamp() {#clamp}
|
|
26
|
+
|
|
27
|
+
> `static` **clamp**(`value`, `minValue?`, `maxValue?`): `number`
|
|
28
|
+
|
|
29
|
+
Clamps a number between a minimum and maximum value.
|
|
30
|
+
|
|
31
|
+
#### Parameters
|
|
32
|
+
|
|
33
|
+
##### value
|
|
34
|
+
|
|
35
|
+
`number`
|
|
36
|
+
|
|
37
|
+
The value to clamp.
|
|
38
|
+
|
|
39
|
+
##### minValue?
|
|
40
|
+
|
|
41
|
+
`number`
|
|
42
|
+
|
|
43
|
+
The minimum value.
|
|
44
|
+
|
|
45
|
+
##### maxValue?
|
|
46
|
+
|
|
47
|
+
`number`
|
|
48
|
+
|
|
49
|
+
The maximum value.
|
|
50
|
+
|
|
51
|
+
#### Returns
|
|
52
|
+
|
|
53
|
+
`number`
|
|
54
|
+
|
|
55
|
+
The clamped value.
|
|
@@ -12,11 +12,19 @@ Class to help with objects.
|
|
|
12
12
|
|
|
13
13
|
`ObjectHelper`
|
|
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
|
-
### toBytes()
|
|
25
|
+
### toBytes() {#tobytes}
|
|
18
26
|
|
|
19
|
-
> `static` **toBytes**\<`T`\>(`obj`, `format
|
|
27
|
+
> `static` **toBytes**\<`T`\>(`obj`, `format?`): `Uint8Array`
|
|
20
28
|
|
|
21
29
|
Convert an object to bytes.
|
|
22
30
|
|
|
@@ -30,11 +38,11 @@ Convert an object to bytes.
|
|
|
30
38
|
|
|
31
39
|
##### obj
|
|
32
40
|
|
|
33
|
-
|
|
41
|
+
`T` \| `undefined`
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
The object to convert.
|
|
36
44
|
|
|
37
|
-
##### format
|
|
45
|
+
##### format?
|
|
38
46
|
|
|
39
47
|
`boolean` = `false`
|
|
40
48
|
|
|
@@ -48,7 +56,7 @@ The object as bytes.
|
|
|
48
56
|
|
|
49
57
|
***
|
|
50
58
|
|
|
51
|
-
### fromBytes()
|
|
59
|
+
### fromBytes() {#frombytes}
|
|
52
60
|
|
|
53
61
|
> `static` **fromBytes**\<`T`\>(`bytes`): `T`
|
|
54
62
|
|
|
@@ -64,9 +72,9 @@ Convert a bytes to an object.
|
|
|
64
72
|
|
|
65
73
|
##### bytes
|
|
66
74
|
|
|
67
|
-
|
|
75
|
+
`Uint8Array`\<`ArrayBufferLike`\> \| `null` \| `undefined`
|
|
68
76
|
|
|
69
|
-
|
|
77
|
+
The bytes to convert to an object.
|
|
70
78
|
|
|
71
79
|
#### Returns
|
|
72
80
|
|
|
@@ -80,7 +88,7 @@ GeneralError if there was an error parsing the JSON.
|
|
|
80
88
|
|
|
81
89
|
***
|
|
82
90
|
|
|
83
|
-
### clone()
|
|
91
|
+
### clone() {#clone}
|
|
84
92
|
|
|
85
93
|
> `static` **clone**\<`T`\>(`obj`): `T`
|
|
86
94
|
|
|
@@ -108,7 +116,7 @@ The objects clone.
|
|
|
108
116
|
|
|
109
117
|
***
|
|
110
118
|
|
|
111
|
-
### merge()
|
|
119
|
+
### merge() {#merge}
|
|
112
120
|
|
|
113
121
|
> `static` **merge**\<`T`, `U`\>(`obj1`, `obj2`): `T` & `U`
|
|
114
122
|
|
|
@@ -146,7 +154,7 @@ The combined deep merge of the objects.
|
|
|
146
154
|
|
|
147
155
|
***
|
|
148
156
|
|
|
149
|
-
### equal()
|
|
157
|
+
### equal() {#equal}
|
|
150
158
|
|
|
151
159
|
> `static` **equal**\<`T`\>(`obj1`, `obj2`, `strictPropertyOrder?`): `boolean`
|
|
152
160
|
|
|
@@ -186,9 +194,9 @@ True is the objects are equal.
|
|
|
186
194
|
|
|
187
195
|
***
|
|
188
196
|
|
|
189
|
-
### propertyGet()
|
|
197
|
+
### propertyGet() {#propertyget}
|
|
190
198
|
|
|
191
|
-
> `static` **propertyGet**\<`T`\>(`obj`, `property`): `
|
|
199
|
+
> `static` **propertyGet**\<`T`\>(`obj`, `property`): `T` \| `undefined`
|
|
192
200
|
|
|
193
201
|
Get the property of an unknown object.
|
|
194
202
|
|
|
@@ -214,13 +222,13 @@ The property to get, can be separated by dots for nested path.
|
|
|
214
222
|
|
|
215
223
|
#### Returns
|
|
216
224
|
|
|
217
|
-
`
|
|
225
|
+
`T` \| `undefined`
|
|
218
226
|
|
|
219
227
|
The property.
|
|
220
228
|
|
|
221
229
|
***
|
|
222
230
|
|
|
223
|
-
### propertySet()
|
|
231
|
+
### propertySet() {#propertyset}
|
|
224
232
|
|
|
225
233
|
> `static` **propertySet**(`obj`, `property`, `value`): `void`
|
|
226
234
|
|
|
@@ -256,7 +264,7 @@ GeneralError if the property target is not an object.
|
|
|
256
264
|
|
|
257
265
|
***
|
|
258
266
|
|
|
259
|
-
### propertyDelete()
|
|
267
|
+
### propertyDelete() {#propertydelete}
|
|
260
268
|
|
|
261
269
|
> `static` **propertyDelete**(`obj`, `property`): `void`
|
|
262
270
|
|
|
@@ -268,13 +276,13 @@ Delete the property of an unknown object.
|
|
|
268
276
|
|
|
269
277
|
`unknown`
|
|
270
278
|
|
|
271
|
-
The object to
|
|
279
|
+
The object to delete the property from.
|
|
272
280
|
|
|
273
281
|
##### property
|
|
274
282
|
|
|
275
283
|
`string`
|
|
276
284
|
|
|
277
|
-
The property to
|
|
285
|
+
The property to delete.
|
|
278
286
|
|
|
279
287
|
#### Returns
|
|
280
288
|
|
|
@@ -282,9 +290,9 @@ The property to set
|
|
|
282
290
|
|
|
283
291
|
***
|
|
284
292
|
|
|
285
|
-
### extractProperty()
|
|
293
|
+
### extractProperty() {#extractproperty}
|
|
286
294
|
|
|
287
|
-
> `static` **extractProperty**\<`T`\>(`obj`, `propertyNames`, `removeProperties
|
|
295
|
+
> `static` **extractProperty**\<`T`\>(`obj`, `propertyNames`, `removeProperties?`): `T` \| `undefined`
|
|
288
296
|
|
|
289
297
|
Extract a property from the object, providing alternative names.
|
|
290
298
|
|
|
@@ -304,11 +312,11 @@ The object to extract from.
|
|
|
304
312
|
|
|
305
313
|
##### propertyNames
|
|
306
314
|
|
|
307
|
-
|
|
315
|
+
`string` \| `string`[]
|
|
308
316
|
|
|
309
|
-
|
|
317
|
+
The possible names for the property.
|
|
310
318
|
|
|
311
|
-
##### removeProperties
|
|
319
|
+
##### removeProperties?
|
|
312
320
|
|
|
313
321
|
`boolean` = `true`
|
|
314
322
|
|
|
@@ -316,81 +324,185 @@ Remove the properties from the object, defaults to true.
|
|
|
316
324
|
|
|
317
325
|
#### Returns
|
|
318
326
|
|
|
319
|
-
`
|
|
327
|
+
`T` \| `undefined`
|
|
320
328
|
|
|
321
329
|
The property if available.
|
|
322
330
|
|
|
323
331
|
***
|
|
324
332
|
|
|
325
|
-
### pick()
|
|
333
|
+
### pick() {#pick}
|
|
326
334
|
|
|
327
|
-
|
|
335
|
+
Pick a subset of properties from an object.
|
|
336
|
+
|
|
337
|
+
#### Param
|
|
338
|
+
|
|
339
|
+
The object to pick the properties from.
|
|
340
|
+
|
|
341
|
+
#### Param
|
|
342
|
+
|
|
343
|
+
The property keys to pick.
|
|
344
|
+
|
|
345
|
+
#### Call Signature
|
|
346
|
+
|
|
347
|
+
> `static` **pick**\<`T`, `K`\>(`obj`, `keys?`): `Pick`\<`T`, `K`\>
|
|
328
348
|
|
|
329
349
|
Pick a subset of properties from an object.
|
|
330
350
|
|
|
331
|
-
|
|
351
|
+
##### Type Parameters
|
|
332
352
|
|
|
333
|
-
|
|
353
|
+
###### T
|
|
334
354
|
|
|
335
355
|
`T`
|
|
336
356
|
|
|
337
|
-
|
|
357
|
+
###### K
|
|
338
358
|
|
|
339
|
-
|
|
359
|
+
`K` *extends* `string` \| `number` \| `symbol`
|
|
360
|
+
|
|
361
|
+
##### Parameters
|
|
362
|
+
|
|
363
|
+
###### obj
|
|
364
|
+
|
|
365
|
+
`T`
|
|
340
366
|
|
|
341
367
|
The object to pick the properties from.
|
|
342
368
|
|
|
343
|
-
|
|
369
|
+
###### keys?
|
|
370
|
+
|
|
371
|
+
`K`[]
|
|
372
|
+
|
|
373
|
+
The property keys to pick.
|
|
374
|
+
|
|
375
|
+
##### Returns
|
|
376
|
+
|
|
377
|
+
`Pick`\<`T`, `K`\>
|
|
378
|
+
|
|
379
|
+
The picked object.
|
|
380
|
+
|
|
381
|
+
#### Call Signature
|
|
382
|
+
|
|
383
|
+
> `static` **pick**\<`T`, `K`\>(`obj`, `keys?`): `Pick`\<`T`, `K`\> \| `undefined`
|
|
384
|
+
|
|
385
|
+
Pick a subset of properties from an object.
|
|
386
|
+
|
|
387
|
+
##### Type Parameters
|
|
388
|
+
|
|
389
|
+
###### T
|
|
390
|
+
|
|
391
|
+
`T`
|
|
392
|
+
|
|
393
|
+
###### K
|
|
394
|
+
|
|
395
|
+
`K` *extends* `string` \| `number` \| `symbol`
|
|
396
|
+
|
|
397
|
+
##### Parameters
|
|
344
398
|
|
|
345
|
-
|
|
399
|
+
###### obj
|
|
346
400
|
|
|
347
|
-
|
|
401
|
+
`T` \| `undefined`
|
|
402
|
+
|
|
403
|
+
The object to pick the properties from.
|
|
404
|
+
|
|
405
|
+
###### keys?
|
|
406
|
+
|
|
407
|
+
`K`[]
|
|
348
408
|
|
|
349
409
|
The property keys to pick.
|
|
350
410
|
|
|
351
|
-
|
|
411
|
+
##### Returns
|
|
352
412
|
|
|
353
|
-
`
|
|
413
|
+
`Pick`\<`T`, `K`\> \| `undefined`
|
|
354
414
|
|
|
355
|
-
The
|
|
415
|
+
The picked object, or undefined if the input was undefined.
|
|
356
416
|
|
|
357
417
|
***
|
|
358
418
|
|
|
359
|
-
### omit()
|
|
419
|
+
### omit() {#omit}
|
|
420
|
+
|
|
421
|
+
Omit a subset of properties from an object.
|
|
422
|
+
|
|
423
|
+
#### Param
|
|
424
|
+
|
|
425
|
+
The object to omit the properties from.
|
|
426
|
+
|
|
427
|
+
#### Param
|
|
360
428
|
|
|
361
|
-
|
|
429
|
+
The property keys to omit.
|
|
430
|
+
|
|
431
|
+
#### Call Signature
|
|
432
|
+
|
|
433
|
+
> `static` **omit**\<`T`, `K`\>(`obj`, `keys?`): `Omit`\<`T`, `K`\>
|
|
362
434
|
|
|
363
435
|
Omit a subset of properties from an object.
|
|
364
436
|
|
|
365
|
-
|
|
437
|
+
##### Type Parameters
|
|
366
438
|
|
|
367
|
-
|
|
439
|
+
###### T
|
|
368
440
|
|
|
369
441
|
`T`
|
|
370
442
|
|
|
371
|
-
|
|
443
|
+
###### K
|
|
372
444
|
|
|
373
|
-
|
|
445
|
+
`K` *extends* `string` \| `number` \| `symbol`
|
|
446
|
+
|
|
447
|
+
##### Parameters
|
|
448
|
+
|
|
449
|
+
###### obj
|
|
450
|
+
|
|
451
|
+
`T`
|
|
374
452
|
|
|
375
453
|
The object to omit the properties from.
|
|
376
454
|
|
|
377
|
-
|
|
455
|
+
###### keys?
|
|
378
456
|
|
|
379
|
-
|
|
457
|
+
`K`[]
|
|
380
458
|
|
|
381
|
-
|
|
459
|
+
The property keys to omit.
|
|
460
|
+
|
|
461
|
+
##### Returns
|
|
462
|
+
|
|
463
|
+
`Omit`\<`T`, `K`\>
|
|
464
|
+
|
|
465
|
+
The object without the omitted keys.
|
|
466
|
+
|
|
467
|
+
#### Call Signature
|
|
468
|
+
|
|
469
|
+
> `static` **omit**\<`T`, `K`\>(`obj`, `keys?`): `Omit`\<`T`, `K`\> \| `undefined`
|
|
470
|
+
|
|
471
|
+
Omit a subset of properties from an object.
|
|
472
|
+
|
|
473
|
+
##### Type Parameters
|
|
474
|
+
|
|
475
|
+
###### T
|
|
476
|
+
|
|
477
|
+
`T`
|
|
478
|
+
|
|
479
|
+
###### K
|
|
480
|
+
|
|
481
|
+
`K` *extends* `string` \| `number` \| `symbol`
|
|
482
|
+
|
|
483
|
+
##### Parameters
|
|
484
|
+
|
|
485
|
+
###### obj
|
|
486
|
+
|
|
487
|
+
`T` \| `undefined`
|
|
488
|
+
|
|
489
|
+
The object to omit the properties from.
|
|
490
|
+
|
|
491
|
+
###### keys?
|
|
492
|
+
|
|
493
|
+
`K`[]
|
|
382
494
|
|
|
383
495
|
The property keys to omit.
|
|
384
496
|
|
|
385
|
-
|
|
497
|
+
##### Returns
|
|
386
498
|
|
|
387
|
-
`
|
|
499
|
+
`Omit`\<`T`, `K`\> \| `undefined`
|
|
388
500
|
|
|
389
|
-
The
|
|
501
|
+
The object without the omitted keys, or undefined if the input was undefined.
|
|
390
502
|
|
|
391
503
|
***
|
|
392
504
|
|
|
393
|
-
### toExtended()
|
|
505
|
+
### toExtended() {#toextended}
|
|
394
506
|
|
|
395
507
|
> `static` **toExtended**(`obj`): `any`
|
|
396
508
|
|
|
@@ -412,7 +524,7 @@ The object with extended properties.
|
|
|
412
524
|
|
|
413
525
|
***
|
|
414
526
|
|
|
415
|
-
### fromExtended()
|
|
527
|
+
### fromExtended() {#fromextended}
|
|
416
528
|
|
|
417
529
|
> `static` **fromExtended**(`obj`): `any`
|
|
418
530
|
|
|
@@ -434,7 +546,7 @@ The object with regular properties.
|
|
|
434
546
|
|
|
435
547
|
***
|
|
436
548
|
|
|
437
|
-
### removeEmptyProperties()
|
|
549
|
+
### removeEmptyProperties() {#removeemptyproperties}
|
|
438
550
|
|
|
439
551
|
> `static` **removeEmptyProperties**\<`T`\>(`obj`, `options?`): `T`
|
|
440
552
|
|