@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
|
@@ -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
|
##### properties?
|
|
32
32
|
|
|
@@ -48,9 +48,9 @@ The cause of the error if we have wrapped another error.
|
|
|
48
48
|
|
|
49
49
|
## Properties
|
|
50
50
|
|
|
51
|
-
### source?
|
|
51
|
+
### source? {#source}
|
|
52
52
|
|
|
53
|
-
> `optional` **source
|
|
53
|
+
> `optional` **source?**: `string`
|
|
54
54
|
|
|
55
55
|
The source of the error.
|
|
56
56
|
|
|
@@ -60,9 +60,9 @@ The source of the error.
|
|
|
60
60
|
|
|
61
61
|
***
|
|
62
62
|
|
|
63
|
-
### properties?
|
|
63
|
+
### properties? {#properties}
|
|
64
64
|
|
|
65
|
-
> `optional` **properties
|
|
65
|
+
> `optional` **properties?**: `object`
|
|
66
66
|
|
|
67
67
|
Any additional information for the error.
|
|
68
68
|
|
|
@@ -76,9 +76,9 @@ Any additional information for the error.
|
|
|
76
76
|
|
|
77
77
|
***
|
|
78
78
|
|
|
79
|
-
### cause?
|
|
79
|
+
### cause? {#cause}
|
|
80
80
|
|
|
81
|
-
> `optional` **cause
|
|
81
|
+
> `optional` **cause?**: [`IError`](../interfaces/IError.md)
|
|
82
82
|
|
|
83
83
|
The cause of the error.
|
|
84
84
|
|
|
@@ -88,7 +88,7 @@ The cause of the error.
|
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
91
|
-
### CLASS\_NAME
|
|
91
|
+
### CLASS\_NAME {#class_name}
|
|
92
92
|
|
|
93
93
|
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
94
94
|
|
|
@@ -96,7 +96,7 @@ Runtime name for the class.
|
|
|
96
96
|
|
|
97
97
|
## Methods
|
|
98
98
|
|
|
99
|
-
### fromError()
|
|
99
|
+
### fromError() {#fromerror}
|
|
100
100
|
|
|
101
101
|
> `static` **fromError**(`err`): [`BaseError`](BaseError.md)
|
|
102
102
|
|
|
@@ -122,7 +122,7 @@ The new instance.
|
|
|
122
122
|
|
|
123
123
|
***
|
|
124
124
|
|
|
125
|
-
### flatten()
|
|
125
|
+
### flatten() {#flatten}
|
|
126
126
|
|
|
127
127
|
> `static` **flatten**(`err`): [`IError`](../interfaces/IError.md)[]
|
|
128
128
|
|
|
@@ -148,9 +148,9 @@ The list of all internal errors.
|
|
|
148
148
|
|
|
149
149
|
***
|
|
150
150
|
|
|
151
|
-
### expand()
|
|
151
|
+
### expand() {#expand}
|
|
152
152
|
|
|
153
|
-
> `static` **expand**(`errors`):
|
|
153
|
+
> `static` **expand**(`errors`): [`IError`](../interfaces/IError.md) \| `undefined`
|
|
154
154
|
|
|
155
155
|
Expand an error tree.
|
|
156
156
|
|
|
@@ -158,13 +158,13 @@ Expand an error tree.
|
|
|
158
158
|
|
|
159
159
|
##### errors
|
|
160
160
|
|
|
161
|
-
|
|
161
|
+
[`IError`](../interfaces/IError.md)[] \| `undefined`
|
|
162
162
|
|
|
163
|
-
|
|
163
|
+
The list of errors to expand.
|
|
164
164
|
|
|
165
165
|
#### Returns
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
[`IError`](../interfaces/IError.md) \| `undefined`
|
|
168
168
|
|
|
169
169
|
The first level error.
|
|
170
170
|
|
|
@@ -174,7 +174,7 @@ The first level error.
|
|
|
174
174
|
|
|
175
175
|
***
|
|
176
176
|
|
|
177
|
-
### isErrorName()
|
|
177
|
+
### isErrorName() {#iserrorname}
|
|
178
178
|
|
|
179
179
|
> `static` **isErrorName**(`error`, `name`): `error is BaseError`
|
|
180
180
|
|
|
@@ -190,9 +190,9 @@ The error to test.
|
|
|
190
190
|
|
|
191
191
|
##### name
|
|
192
192
|
|
|
193
|
-
|
|
193
|
+
`string` \| `RegExp`
|
|
194
194
|
|
|
195
|
-
|
|
195
|
+
The name to check for.
|
|
196
196
|
|
|
197
197
|
#### Returns
|
|
198
198
|
|
|
@@ -206,7 +206,7 @@ True if the error has the name.
|
|
|
206
206
|
|
|
207
207
|
***
|
|
208
208
|
|
|
209
|
-
### isErrorMessage()
|
|
209
|
+
### isErrorMessage() {#iserrormessage}
|
|
210
210
|
|
|
211
211
|
> `static` **isErrorMessage**(`error`, `message`): `error is BaseError`
|
|
212
212
|
|
|
@@ -222,9 +222,9 @@ The error to test.
|
|
|
222
222
|
|
|
223
223
|
##### message
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
`string` \| `RegExp`
|
|
226
226
|
|
|
227
|
-
|
|
227
|
+
The message to check for.
|
|
228
228
|
|
|
229
229
|
#### Returns
|
|
230
230
|
|
|
@@ -238,7 +238,7 @@ True if the error has the name.
|
|
|
238
238
|
|
|
239
239
|
***
|
|
240
240
|
|
|
241
|
-
### isErrorCode()
|
|
241
|
+
### isErrorCode() {#iserrorcode}
|
|
242
242
|
|
|
243
243
|
> `static` **isErrorCode**(`error`, `code`): `boolean`
|
|
244
244
|
|
|
@@ -254,9 +254,9 @@ The error to test.
|
|
|
254
254
|
|
|
255
255
|
##### code
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
`string` \| `RegExp`
|
|
258
258
|
|
|
259
|
-
|
|
259
|
+
The code to check for.
|
|
260
260
|
|
|
261
261
|
#### Returns
|
|
262
262
|
|
|
@@ -270,7 +270,7 @@ True if the error has the code.
|
|
|
270
270
|
|
|
271
271
|
***
|
|
272
272
|
|
|
273
|
-
### someErrorName()
|
|
273
|
+
### someErrorName() {#someerrorname}
|
|
274
274
|
|
|
275
275
|
> `static` **someErrorName**(`error`, `name`): `error is BaseError`
|
|
276
276
|
|
|
@@ -286,9 +286,9 @@ The error to test.
|
|
|
286
286
|
|
|
287
287
|
##### name
|
|
288
288
|
|
|
289
|
-
|
|
289
|
+
`string` \| `RegExp`
|
|
290
290
|
|
|
291
|
-
|
|
291
|
+
The name to check for.
|
|
292
292
|
|
|
293
293
|
#### Returns
|
|
294
294
|
|
|
@@ -302,7 +302,7 @@ True if the error has the name.
|
|
|
302
302
|
|
|
303
303
|
***
|
|
304
304
|
|
|
305
|
-
### someErrorMessage()
|
|
305
|
+
### someErrorMessage() {#someerrormessage}
|
|
306
306
|
|
|
307
307
|
> `static` **someErrorMessage**(`error`, `message`): `error is BaseError`
|
|
308
308
|
|
|
@@ -318,9 +318,9 @@ The error to test.
|
|
|
318
318
|
|
|
319
319
|
##### message
|
|
320
320
|
|
|
321
|
-
|
|
321
|
+
`string` \| `RegExp`
|
|
322
322
|
|
|
323
|
-
|
|
323
|
+
The message to check for.
|
|
324
324
|
|
|
325
325
|
#### Returns
|
|
326
326
|
|
|
@@ -334,7 +334,7 @@ True if the error has the name.
|
|
|
334
334
|
|
|
335
335
|
***
|
|
336
336
|
|
|
337
|
-
### someErrorClass()
|
|
337
|
+
### someErrorClass() {#someerrorclass}
|
|
338
338
|
|
|
339
339
|
> `static` **someErrorClass**(`error`, `cls`): `error is BaseError`
|
|
340
340
|
|
|
@@ -366,7 +366,7 @@ True if the error has the specific class.
|
|
|
366
366
|
|
|
367
367
|
***
|
|
368
368
|
|
|
369
|
-
### someErrorCode()
|
|
369
|
+
### someErrorCode() {#someerrorcode}
|
|
370
370
|
|
|
371
371
|
> `static` **someErrorCode**(`error`, `code`): `error is BaseError`
|
|
372
372
|
|
|
@@ -382,9 +382,9 @@ The error to test.
|
|
|
382
382
|
|
|
383
383
|
##### code
|
|
384
384
|
|
|
385
|
-
|
|
385
|
+
`string` \| `RegExp`
|
|
386
386
|
|
|
387
|
-
|
|
387
|
+
The code to check for.
|
|
388
388
|
|
|
389
389
|
#### Returns
|
|
390
390
|
|
|
@@ -398,7 +398,7 @@ True if the error has the name.
|
|
|
398
398
|
|
|
399
399
|
***
|
|
400
400
|
|
|
401
|
-
### isEmpty()
|
|
401
|
+
### isEmpty() {#isempty}
|
|
402
402
|
|
|
403
403
|
> `static` **isEmpty**(`err`): `boolean`
|
|
404
404
|
|
|
@@ -424,7 +424,7 @@ True if the error is empty.
|
|
|
424
424
|
|
|
425
425
|
***
|
|
426
426
|
|
|
427
|
-
### isAggregateError()
|
|
427
|
+
### isAggregateError() {#isaggregateerror}
|
|
428
428
|
|
|
429
429
|
> `static` **isAggregateError**(`err`): `err is AggregateError`
|
|
430
430
|
|
|
@@ -450,7 +450,7 @@ True if the error is an aggregate error.
|
|
|
450
450
|
|
|
451
451
|
***
|
|
452
452
|
|
|
453
|
-
### fromAggregate()
|
|
453
|
+
### fromAggregate() {#fromaggregate}
|
|
454
454
|
|
|
455
455
|
> `static` **fromAggregate**(`err`, `includeStackTrace?`): [`IError`](../interfaces/IError.md)[]
|
|
456
456
|
|
|
@@ -482,7 +482,7 @@ The array of errors.
|
|
|
482
482
|
|
|
483
483
|
***
|
|
484
484
|
|
|
485
|
-
### toJsonObject()
|
|
485
|
+
### toJsonObject() {#tojsonobject}
|
|
486
486
|
|
|
487
487
|
> **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
|
|
488
488
|
|
|
@@ -22,11 +22,19 @@ The url string.
|
|
|
22
22
|
|
|
23
23
|
`Url`
|
|
24
24
|
|
|
25
|
+
## Properties
|
|
26
|
+
|
|
27
|
+
### CLASS\_NAME {#class_name}
|
|
28
|
+
|
|
29
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
30
|
+
|
|
31
|
+
Runtime name for the class.
|
|
32
|
+
|
|
25
33
|
## Methods
|
|
26
34
|
|
|
27
|
-
### tryParseExact()
|
|
35
|
+
### tryParseExact() {#tryparseexact}
|
|
28
36
|
|
|
29
|
-
> `static` **tryParseExact**(`url`): `
|
|
37
|
+
> `static` **tryParseExact**(`url`): `Url` \| `undefined`
|
|
30
38
|
|
|
31
39
|
Try and parse a string into the url parts.
|
|
32
40
|
|
|
@@ -40,13 +48,13 @@ The url to parse.
|
|
|
40
48
|
|
|
41
49
|
#### Returns
|
|
42
50
|
|
|
43
|
-
`
|
|
51
|
+
`Url` \| `undefined`
|
|
44
52
|
|
|
45
53
|
The formatted url or undefined if the value is not a url.
|
|
46
54
|
|
|
47
55
|
***
|
|
48
56
|
|
|
49
|
-
### guard()
|
|
57
|
+
### guard() {#guard}
|
|
50
58
|
|
|
51
59
|
> `static` **guard**(`source`, `property`, `value`): `asserts value is string`
|
|
52
60
|
|
|
@@ -82,9 +90,9 @@ GuardError If the value does not match the assertion.
|
|
|
82
90
|
|
|
83
91
|
***
|
|
84
92
|
|
|
85
|
-
### validate()
|
|
93
|
+
### validate() {#validate}
|
|
86
94
|
|
|
87
|
-
> `static` **validate**(`property`, `value`, `failures`): `value is Url`
|
|
95
|
+
> `static` **validate**(`property`, `value`, `failures`, `fieldNameResource?`): `value is Url`
|
|
88
96
|
|
|
89
97
|
Validate a string as a Url.
|
|
90
98
|
|
|
@@ -108,6 +116,12 @@ The url to parse.
|
|
|
108
116
|
|
|
109
117
|
The list of failures to add to.
|
|
110
118
|
|
|
119
|
+
##### fieldNameResource?
|
|
120
|
+
|
|
121
|
+
`string`
|
|
122
|
+
|
|
123
|
+
The optional human readable name for the field as an i18 resource.
|
|
124
|
+
|
|
111
125
|
#### Returns
|
|
112
126
|
|
|
113
127
|
`value is Url`
|
|
@@ -116,7 +130,7 @@ The formatted url.
|
|
|
116
130
|
|
|
117
131
|
***
|
|
118
132
|
|
|
119
|
-
### fromURLToParts()
|
|
133
|
+
### fromURLToParts() {#fromurltoparts}
|
|
120
134
|
|
|
121
135
|
> `static` **fromURLToParts**(`url`): [`IUrlParts`](../interfaces/IUrlParts.md)
|
|
122
136
|
|
|
@@ -138,7 +152,7 @@ The formatted url.
|
|
|
138
152
|
|
|
139
153
|
***
|
|
140
154
|
|
|
141
|
-
### fromParts()
|
|
155
|
+
### fromParts() {#fromparts}
|
|
142
156
|
|
|
143
157
|
> `static` **fromParts**(`urlParts`): `Url`
|
|
144
158
|
|
|
@@ -160,7 +174,7 @@ The formatted url.
|
|
|
160
174
|
|
|
161
175
|
***
|
|
162
176
|
|
|
163
|
-
### parts()
|
|
177
|
+
### parts() {#parts}
|
|
164
178
|
|
|
165
179
|
> **parts**(): [`IUrlParts`](../interfaces/IUrlParts.md)
|
|
166
180
|
|
|
@@ -174,7 +188,7 @@ The parts of the url.
|
|
|
174
188
|
|
|
175
189
|
***
|
|
176
190
|
|
|
177
|
-
### toString()
|
|
191
|
+
### toString() {#tostring}
|
|
178
192
|
|
|
179
193
|
> **toString**(): `string`
|
|
180
194
|
|
|
@@ -20,17 +20,25 @@ The identifier for the namespace.
|
|
|
20
20
|
|
|
21
21
|
##### namespaceSpecific
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
`string` \| `string`[]
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
The specific part of the namespace.
|
|
26
26
|
|
|
27
27
|
#### Returns
|
|
28
28
|
|
|
29
29
|
`Urn`
|
|
30
30
|
|
|
31
|
+
## Properties
|
|
32
|
+
|
|
33
|
+
### CLASS\_NAME {#class_name}
|
|
34
|
+
|
|
35
|
+
> `readonly` `static` **CLASS\_NAME**: `string`
|
|
36
|
+
|
|
37
|
+
Runtime name for the class.
|
|
38
|
+
|
|
31
39
|
## Methods
|
|
32
40
|
|
|
33
|
-
### generateRandom()
|
|
41
|
+
### generateRandom() {#generaterandom}
|
|
34
42
|
|
|
35
43
|
> `static` **generateRandom**(`namespace`): `Urn`
|
|
36
44
|
|
|
@@ -52,7 +60,7 @@ A new Id in URN format.
|
|
|
52
60
|
|
|
53
61
|
***
|
|
54
62
|
|
|
55
|
-
### hasNamespace()
|
|
63
|
+
### hasNamespace() {#hasnamespace}
|
|
56
64
|
|
|
57
65
|
> `static` **hasNamespace**(`urn`, `namespace`): `boolean`
|
|
58
66
|
|
|
@@ -80,9 +88,9 @@ True if the namespace matches.
|
|
|
80
88
|
|
|
81
89
|
***
|
|
82
90
|
|
|
83
|
-
### tryParseExact()
|
|
91
|
+
### tryParseExact() {#tryparseexact}
|
|
84
92
|
|
|
85
|
-
> `static` **tryParseExact**(`urn`): `
|
|
93
|
+
> `static` **tryParseExact**(`urn`): `Urn` \| `undefined`
|
|
86
94
|
|
|
87
95
|
Try and parse a string into the urn parts.
|
|
88
96
|
|
|
@@ -96,13 +104,13 @@ The urn to parse.
|
|
|
96
104
|
|
|
97
105
|
#### Returns
|
|
98
106
|
|
|
99
|
-
`
|
|
107
|
+
`Urn` \| `undefined`
|
|
100
108
|
|
|
101
109
|
The formatted urn or undefined if the value is not a urn.
|
|
102
110
|
|
|
103
111
|
***
|
|
104
112
|
|
|
105
|
-
### fromValidString()
|
|
113
|
+
### fromValidString() {#fromvalidstring}
|
|
106
114
|
|
|
107
115
|
> `static` **fromValidString**(`urn`): `Urn`
|
|
108
116
|
|
|
@@ -124,9 +132,9 @@ The formatted urn.
|
|
|
124
132
|
|
|
125
133
|
***
|
|
126
134
|
|
|
127
|
-
### addPrefix()
|
|
135
|
+
### addPrefix() {#addprefix}
|
|
128
136
|
|
|
129
|
-
> `static` **addPrefix**(`urn`): `
|
|
137
|
+
> `static` **addPrefix**(`urn`): `string` \| `undefined`
|
|
130
138
|
|
|
131
139
|
Add a urn: prefix if there isn't one already.
|
|
132
140
|
|
|
@@ -140,13 +148,13 @@ The urn string to add a prefix to.
|
|
|
140
148
|
|
|
141
149
|
#### Returns
|
|
142
150
|
|
|
143
|
-
`
|
|
151
|
+
`string` \| `undefined`
|
|
144
152
|
|
|
145
153
|
The urn with a prefix.
|
|
146
154
|
|
|
147
155
|
***
|
|
148
156
|
|
|
149
|
-
### guard()
|
|
157
|
+
### guard() {#guard}
|
|
150
158
|
|
|
151
159
|
> `static` **guard**(`source`, `property`, `value`): `asserts value is string`
|
|
152
160
|
|
|
@@ -182,9 +190,9 @@ GuardError If the value does not match the assertion.
|
|
|
182
190
|
|
|
183
191
|
***
|
|
184
192
|
|
|
185
|
-
### validate()
|
|
193
|
+
### validate() {#validate}
|
|
186
194
|
|
|
187
|
-
> `static` **validate**(`property`, `value`, `failures`): `value is string`
|
|
195
|
+
> `static` **validate**(`property`, `value`, `failures`, `fieldNameResource?`): `value is string`
|
|
188
196
|
|
|
189
197
|
Validate a string as a Urn.
|
|
190
198
|
|
|
@@ -208,6 +216,12 @@ The urn to parse.
|
|
|
208
216
|
|
|
209
217
|
The list of failures to add to.
|
|
210
218
|
|
|
219
|
+
##### fieldNameResource?
|
|
220
|
+
|
|
221
|
+
`string`
|
|
222
|
+
|
|
223
|
+
The optional human readable name for the field as an i18 resource.
|
|
224
|
+
|
|
211
225
|
#### Returns
|
|
212
226
|
|
|
213
227
|
`value is string`
|
|
@@ -216,15 +230,15 @@ The formatted urn.
|
|
|
216
230
|
|
|
217
231
|
***
|
|
218
232
|
|
|
219
|
-
### parts()
|
|
233
|
+
### parts() {#parts}
|
|
220
234
|
|
|
221
|
-
> **parts**(`startIndex
|
|
235
|
+
> **parts**(`startIndex?`): `string`[]
|
|
222
236
|
|
|
223
237
|
Get the parts.
|
|
224
238
|
|
|
225
239
|
#### Parameters
|
|
226
240
|
|
|
227
|
-
##### startIndex
|
|
241
|
+
##### startIndex?
|
|
228
242
|
|
|
229
243
|
`number` = `0`
|
|
230
244
|
|
|
@@ -238,7 +252,7 @@ The parts.
|
|
|
238
252
|
|
|
239
253
|
***
|
|
240
254
|
|
|
241
|
-
### namespaceIdentifier()
|
|
255
|
+
### namespaceIdentifier() {#namespaceidentifier}
|
|
242
256
|
|
|
243
257
|
> **namespaceIdentifier**(): `string`
|
|
244
258
|
|
|
@@ -252,7 +266,7 @@ The namespace identifier.
|
|
|
252
266
|
|
|
253
267
|
***
|
|
254
268
|
|
|
255
|
-
### namespaceMethod()
|
|
269
|
+
### namespaceMethod() {#namespacemethod}
|
|
256
270
|
|
|
257
271
|
> **namespaceMethod**(): `string`
|
|
258
272
|
|
|
@@ -266,15 +280,15 @@ The namespace method.
|
|
|
266
280
|
|
|
267
281
|
***
|
|
268
282
|
|
|
269
|
-
### namespaceSpecificParts()
|
|
283
|
+
### namespaceSpecificParts() {#namespacespecificparts}
|
|
270
284
|
|
|
271
|
-
> **namespaceSpecificParts**(`startIndex
|
|
285
|
+
> **namespaceSpecificParts**(`startIndex?`): `string`[]
|
|
272
286
|
|
|
273
287
|
Get the namespace specific parts.
|
|
274
288
|
|
|
275
289
|
#### Parameters
|
|
276
290
|
|
|
277
|
-
##### startIndex
|
|
291
|
+
##### startIndex?
|
|
278
292
|
|
|
279
293
|
`number` = `0`
|
|
280
294
|
|
|
@@ -288,15 +302,15 @@ The namespace specific parts.
|
|
|
288
302
|
|
|
289
303
|
***
|
|
290
304
|
|
|
291
|
-
### namespaceSpecific()
|
|
305
|
+
### namespaceSpecific() {#namespacespecific}
|
|
292
306
|
|
|
293
|
-
> **namespaceSpecific**(`startIndex
|
|
307
|
+
> **namespaceSpecific**(`startIndex?`): `string`
|
|
294
308
|
|
|
295
309
|
Get the namespace specific.
|
|
296
310
|
|
|
297
311
|
#### Parameters
|
|
298
312
|
|
|
299
|
-
##### startIndex
|
|
313
|
+
##### startIndex?
|
|
300
314
|
|
|
301
315
|
`number` = `0`
|
|
302
316
|
|
|
@@ -310,15 +324,15 @@ The namespace specific.
|
|
|
310
324
|
|
|
311
325
|
***
|
|
312
326
|
|
|
313
|
-
### toString()
|
|
327
|
+
### toString() {#tostring}
|
|
314
328
|
|
|
315
|
-
> **toString**(`omitPrefix
|
|
329
|
+
> **toString**(`omitPrefix?`): `string`
|
|
316
330
|
|
|
317
331
|
Convert the parts in to a full string.
|
|
318
332
|
|
|
319
333
|
#### Parameters
|
|
320
334
|
|
|
321
|
-
##### omitPrefix
|
|
335
|
+
##### omitPrefix?
|
|
322
336
|
|
|
323
337
|
`boolean` = `true`
|
|
324
338
|
|