@twin.org/core 0.0.1-next.5 → 0.0.1-next.50
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/dist/cjs/index.cjs +1401 -736
- package/dist/esm/index.mjs +1398 -737
- package/dist/types/encoding/base58.d.ts +18 -0
- package/dist/types/factories/factory.d.ts +20 -1
- package/dist/types/helpers/envHelper.d.ts +16 -0
- package/dist/types/helpers/jsonHelper.d.ts +30 -0
- package/dist/types/helpers/objectHelper.d.ts +33 -0
- package/dist/types/helpers/uint8ArrayHelper.d.ts +11 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/models/IComponent.d.ts +12 -3
- package/dist/types/models/coerceType.d.ts +49 -0
- package/dist/types/models/compressionType.d.ts +1 -1
- package/dist/types/utils/asyncCache.d.ts +8 -0
- package/dist/types/utils/coerce.d.ts +22 -0
- package/dist/types/utils/converter.d.ts +12 -0
- package/dist/types/utils/guards.d.ts +16 -0
- package/dist/types/utils/is.d.ts +12 -0
- package/dist/types/utils/validation.d.ts +2 -0
- package/docs/changelog.md +8 -1
- package/docs/reference/classes/AlreadyExistsError.md +67 -25
- package/docs/reference/classes/ArrayHelper.md +6 -2
- package/docs/reference/classes/AsyncCache.md +56 -6
- package/docs/reference/classes/Base32.md +6 -2
- package/docs/reference/classes/Base58.md +61 -0
- package/docs/reference/classes/Base64.md +9 -3
- package/docs/reference/classes/Base64Url.md +6 -2
- package/docs/reference/classes/BaseError.md +65 -23
- package/docs/reference/classes/BitString.md +18 -6
- package/docs/reference/classes/Coerce.md +104 -8
- package/docs/reference/classes/Compression.md +16 -8
- package/docs/reference/classes/ConflictError.md +70 -26
- package/docs/reference/classes/Converter.md +104 -20
- package/docs/reference/classes/EnvHelper.md +43 -0
- package/docs/reference/classes/ErrorHelper.md +9 -3
- package/docs/reference/classes/Factory.md +78 -10
- package/docs/reference/classes/FilenameHelper.md +3 -1
- package/docs/reference/classes/GeneralError.md +65 -25
- package/docs/reference/classes/GuardError.md +70 -26
- package/docs/reference/classes/Guards.md +286 -74
- package/docs/reference/classes/HexHelper.md +15 -5
- package/docs/reference/classes/I18n.md +42 -16
- package/docs/reference/classes/Is.md +160 -44
- package/docs/reference/classes/JsonHelper.md +137 -5
- package/docs/reference/classes/NotFoundError.md +67 -25
- package/docs/reference/classes/NotImplementedError.md +61 -23
- package/docs/reference/classes/NotSupportedError.md +64 -24
- package/docs/reference/classes/ObjectHelper.md +188 -20
- package/docs/reference/classes/RandomHelper.md +3 -1
- package/docs/reference/classes/StringHelper.md +51 -17
- package/docs/reference/classes/Uint8ArrayHelper.md +35 -0
- package/docs/reference/classes/UnauthorizedError.md +64 -24
- package/docs/reference/classes/UnprocessableError.md +65 -25
- package/docs/reference/classes/Url.md +30 -10
- package/docs/reference/classes/Urn.md +54 -18
- package/docs/reference/classes/Validation.md +315 -109
- package/docs/reference/classes/ValidationError.md +64 -24
- package/docs/reference/index.md +5 -0
- package/docs/reference/interfaces/IComponent.md +30 -8
- package/docs/reference/interfaces/IError.md +1 -1
- package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
- package/docs/reference/interfaces/IValidationFailure.md +1 -1
- package/docs/reference/type-aliases/CoerceType.md +5 -0
- package/docs/reference/variables/CoerceType.md +67 -0
- package/docs/reference/variables/CompressionType.md +1 -1
- package/locales/en.json +21 -1
- package/package.json +6 -6
|
@@ -16,23 +16,27 @@ A class to handle compression.
|
|
|
16
16
|
|
|
17
17
|
### compress()
|
|
18
18
|
|
|
19
|
-
> `static` **compress**(`bytes`, `type`): `Promise`\<`Uint8Array
|
|
19
|
+
> `static` **compress**(`bytes`, `type`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
20
20
|
|
|
21
21
|
Compress bytes using GZIP.
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### bytes
|
|
26
|
+
|
|
27
|
+
`Uint8Array`
|
|
26
28
|
|
|
27
29
|
The bytes to compress.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
##### type
|
|
32
|
+
|
|
33
|
+
[`CompressionType`](../type-aliases/CompressionType.md)
|
|
30
34
|
|
|
31
35
|
The type of compression to use.
|
|
32
36
|
|
|
33
37
|
#### Returns
|
|
34
38
|
|
|
35
|
-
`Promise`\<`Uint8Array
|
|
39
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
36
40
|
|
|
37
41
|
The compressed bytes.
|
|
38
42
|
|
|
@@ -40,22 +44,26 @@ The compressed bytes.
|
|
|
40
44
|
|
|
41
45
|
### decompress()
|
|
42
46
|
|
|
43
|
-
> `static` **decompress**(`compressedBytes`, `type`): `Promise`\<`Uint8Array
|
|
47
|
+
> `static` **decompress**(`compressedBytes`, `type`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
44
48
|
|
|
45
49
|
Decompress a gzipped compressed byte array.
|
|
46
50
|
|
|
47
51
|
#### Parameters
|
|
48
52
|
|
|
49
|
-
|
|
53
|
+
##### compressedBytes
|
|
54
|
+
|
|
55
|
+
`Uint8Array`
|
|
50
56
|
|
|
51
57
|
The compressed bytes.
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
##### type
|
|
60
|
+
|
|
61
|
+
[`CompressionType`](../type-aliases/CompressionType.md)
|
|
54
62
|
|
|
55
63
|
The type of compression to use.
|
|
56
64
|
|
|
57
65
|
#### Returns
|
|
58
66
|
|
|
59
|
-
`Promise`\<`Uint8Array
|
|
67
|
+
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
|
|
60
68
|
|
|
61
69
|
The decompressed bytes.
|
|
@@ -16,23 +16,33 @@ Create a new instance of ConflictError.
|
|
|
16
16
|
|
|
17
17
|
#### Parameters
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
##### source
|
|
20
|
+
|
|
21
|
+
`string`
|
|
20
22
|
|
|
21
23
|
The source of the error.
|
|
22
24
|
|
|
23
|
-
|
|
25
|
+
##### message
|
|
26
|
+
|
|
27
|
+
`string`
|
|
24
28
|
|
|
25
29
|
The message as a code.
|
|
26
30
|
|
|
27
|
-
|
|
31
|
+
##### conflictId?
|
|
32
|
+
|
|
33
|
+
`string`
|
|
28
34
|
|
|
29
35
|
The id that has conflicts.
|
|
30
36
|
|
|
31
|
-
|
|
37
|
+
##### conflicts?
|
|
38
|
+
|
|
39
|
+
`string`[]
|
|
32
40
|
|
|
33
41
|
The conflicts that occurred.
|
|
34
42
|
|
|
35
|
-
|
|
43
|
+
##### inner?
|
|
44
|
+
|
|
45
|
+
`unknown`
|
|
36
46
|
|
|
37
47
|
The inner error if we have wrapped another error.
|
|
38
48
|
|
|
@@ -54,7 +64,7 @@ The source of the error.
|
|
|
54
64
|
|
|
55
65
|
#### Inherited from
|
|
56
66
|
|
|
57
|
-
[`BaseError`](BaseError.md).[`source`](BaseError.md#source)
|
|
67
|
+
[`BaseError`](BaseError.md).[`source`](BaseError.md#source-1)
|
|
58
68
|
|
|
59
69
|
***
|
|
60
70
|
|
|
@@ -66,11 +76,11 @@ Any additional information for the error.
|
|
|
66
76
|
|
|
67
77
|
#### Index Signature
|
|
68
78
|
|
|
69
|
-
|
|
79
|
+
\[`id`: `string`\]: `unknown`
|
|
70
80
|
|
|
71
81
|
#### Inherited from
|
|
72
82
|
|
|
73
|
-
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
|
|
83
|
+
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties-1)
|
|
74
84
|
|
|
75
85
|
***
|
|
76
86
|
|
|
@@ -82,7 +92,7 @@ The inner error if there was one.
|
|
|
82
92
|
|
|
83
93
|
#### Inherited from
|
|
84
94
|
|
|
85
|
-
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
|
|
95
|
+
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner-1)
|
|
86
96
|
|
|
87
97
|
***
|
|
88
98
|
|
|
@@ -102,7 +112,9 @@ Construct an error from an existing one.
|
|
|
102
112
|
|
|
103
113
|
#### Parameters
|
|
104
114
|
|
|
105
|
-
|
|
115
|
+
##### err
|
|
116
|
+
|
|
117
|
+
`unknown`
|
|
106
118
|
|
|
107
119
|
The existing error.
|
|
108
120
|
|
|
@@ -126,7 +138,9 @@ Flatten an error tree.
|
|
|
126
138
|
|
|
127
139
|
#### Parameters
|
|
128
140
|
|
|
129
|
-
|
|
141
|
+
##### err
|
|
142
|
+
|
|
143
|
+
`unknown`
|
|
130
144
|
|
|
131
145
|
The starting error.
|
|
132
146
|
|
|
@@ -150,10 +164,12 @@ Expand an error tree.
|
|
|
150
164
|
|
|
151
165
|
#### Parameters
|
|
152
166
|
|
|
153
|
-
|
|
167
|
+
##### errors
|
|
154
168
|
|
|
155
169
|
The list of errors to expand.
|
|
156
170
|
|
|
171
|
+
`undefined` | [`IError`](../interfaces/IError.md)[]
|
|
172
|
+
|
|
157
173
|
#### Returns
|
|
158
174
|
|
|
159
175
|
`undefined` \| [`IError`](../interfaces/IError.md)
|
|
@@ -174,14 +190,18 @@ Test to see if the error has the specified error name.
|
|
|
174
190
|
|
|
175
191
|
#### Parameters
|
|
176
192
|
|
|
177
|
-
|
|
193
|
+
##### error
|
|
194
|
+
|
|
195
|
+
`unknown`
|
|
178
196
|
|
|
179
197
|
The error to test.
|
|
180
198
|
|
|
181
|
-
|
|
199
|
+
##### name
|
|
182
200
|
|
|
183
201
|
The name to check for.
|
|
184
202
|
|
|
203
|
+
`string` | `RegExp`
|
|
204
|
+
|
|
185
205
|
#### Returns
|
|
186
206
|
|
|
187
207
|
`error is BaseError`
|
|
@@ -202,14 +222,18 @@ Test to see if the error has the specified error message.
|
|
|
202
222
|
|
|
203
223
|
#### Parameters
|
|
204
224
|
|
|
205
|
-
|
|
225
|
+
##### error
|
|
226
|
+
|
|
227
|
+
`unknown`
|
|
206
228
|
|
|
207
229
|
The error to test.
|
|
208
230
|
|
|
209
|
-
|
|
231
|
+
##### message
|
|
210
232
|
|
|
211
233
|
The message to check for.
|
|
212
234
|
|
|
235
|
+
`string` | `RegExp`
|
|
236
|
+
|
|
213
237
|
#### Returns
|
|
214
238
|
|
|
215
239
|
`error is BaseError`
|
|
@@ -230,14 +254,18 @@ Test to see if the error has the specified error code.
|
|
|
230
254
|
|
|
231
255
|
#### Parameters
|
|
232
256
|
|
|
233
|
-
|
|
257
|
+
##### error
|
|
258
|
+
|
|
259
|
+
`unknown`
|
|
234
260
|
|
|
235
261
|
The error to test.
|
|
236
262
|
|
|
237
|
-
|
|
263
|
+
##### code
|
|
238
264
|
|
|
239
265
|
The code to check for.
|
|
240
266
|
|
|
267
|
+
`string` | `RegExp`
|
|
268
|
+
|
|
241
269
|
#### Returns
|
|
242
270
|
|
|
243
271
|
`boolean`
|
|
@@ -258,14 +286,18 @@ Test to see if any of the errors or children have the given error name.
|
|
|
258
286
|
|
|
259
287
|
#### Parameters
|
|
260
288
|
|
|
261
|
-
|
|
289
|
+
##### error
|
|
290
|
+
|
|
291
|
+
`unknown`
|
|
262
292
|
|
|
263
293
|
The error to test.
|
|
264
294
|
|
|
265
|
-
|
|
295
|
+
##### name
|
|
266
296
|
|
|
267
297
|
The name to check for.
|
|
268
298
|
|
|
299
|
+
`string` | `RegExp`
|
|
300
|
+
|
|
269
301
|
#### Returns
|
|
270
302
|
|
|
271
303
|
`error is BaseError`
|
|
@@ -286,14 +318,18 @@ Test to see if any of the errors or children have the given error message.
|
|
|
286
318
|
|
|
287
319
|
#### Parameters
|
|
288
320
|
|
|
289
|
-
|
|
321
|
+
##### error
|
|
322
|
+
|
|
323
|
+
`unknown`
|
|
290
324
|
|
|
291
325
|
The error to test.
|
|
292
326
|
|
|
293
|
-
|
|
327
|
+
##### message
|
|
294
328
|
|
|
295
329
|
The message to check for.
|
|
296
330
|
|
|
331
|
+
`string` | `RegExp`
|
|
332
|
+
|
|
297
333
|
#### Returns
|
|
298
334
|
|
|
299
335
|
`error is BaseError`
|
|
@@ -314,11 +350,15 @@ Test to see if any of the errors or children are from a specific class.
|
|
|
314
350
|
|
|
315
351
|
#### Parameters
|
|
316
352
|
|
|
317
|
-
|
|
353
|
+
##### error
|
|
354
|
+
|
|
355
|
+
`unknown`
|
|
318
356
|
|
|
319
357
|
The error to test.
|
|
320
358
|
|
|
321
|
-
|
|
359
|
+
##### cls
|
|
360
|
+
|
|
361
|
+
`string`
|
|
322
362
|
|
|
323
363
|
The class to check for.
|
|
324
364
|
|
|
@@ -342,14 +382,18 @@ Test to see if any of the errors or children have the given error code.
|
|
|
342
382
|
|
|
343
383
|
#### Parameters
|
|
344
384
|
|
|
345
|
-
|
|
385
|
+
##### error
|
|
386
|
+
|
|
387
|
+
`unknown`
|
|
346
388
|
|
|
347
389
|
The error to test.
|
|
348
390
|
|
|
349
|
-
|
|
391
|
+
##### code
|
|
350
392
|
|
|
351
393
|
The code to check for.
|
|
352
394
|
|
|
395
|
+
`string` | `RegExp`
|
|
396
|
+
|
|
353
397
|
#### Returns
|
|
354
398
|
|
|
355
399
|
`error is BaseError`
|
|
@@ -22,15 +22,21 @@ Encode a raw array to UTF8 string.
|
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### array
|
|
26
|
+
|
|
27
|
+
`ArrayLike`\<`number`\>
|
|
26
28
|
|
|
27
29
|
The bytes to encode.
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
##### startIndex?
|
|
32
|
+
|
|
33
|
+
`number`
|
|
30
34
|
|
|
31
35
|
The index to start in the bytes.
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
##### length?
|
|
38
|
+
|
|
39
|
+
`number`
|
|
34
40
|
|
|
35
41
|
The length of bytes to read.
|
|
36
42
|
|
|
@@ -50,7 +56,9 @@ Convert a UTF8 string to raw array.
|
|
|
50
56
|
|
|
51
57
|
#### Parameters
|
|
52
58
|
|
|
53
|
-
|
|
59
|
+
##### utf8
|
|
60
|
+
|
|
61
|
+
`string`
|
|
54
62
|
|
|
55
63
|
The text to decode.
|
|
56
64
|
|
|
@@ -70,23 +78,33 @@ Encode a raw array to hex string.
|
|
|
70
78
|
|
|
71
79
|
#### Parameters
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
##### array
|
|
82
|
+
|
|
83
|
+
`ArrayLike`\<`number`\>
|
|
74
84
|
|
|
75
85
|
The bytes to encode.
|
|
76
86
|
|
|
77
|
-
|
|
87
|
+
##### includePrefix
|
|
88
|
+
|
|
89
|
+
`boolean` = `false`
|
|
78
90
|
|
|
79
91
|
Include the 0x prefix on the returned hex.
|
|
80
92
|
|
|
81
|
-
|
|
93
|
+
##### startIndex?
|
|
94
|
+
|
|
95
|
+
`number`
|
|
82
96
|
|
|
83
97
|
The index to start in the bytes.
|
|
84
98
|
|
|
85
|
-
|
|
99
|
+
##### length?
|
|
100
|
+
|
|
101
|
+
`number`
|
|
86
102
|
|
|
87
103
|
The length of bytes to read.
|
|
88
104
|
|
|
89
|
-
|
|
105
|
+
##### reverse?
|
|
106
|
+
|
|
107
|
+
`boolean`
|
|
90
108
|
|
|
91
109
|
Reverse the combine direction.
|
|
92
110
|
|
|
@@ -106,11 +124,15 @@ Decode a hex string to raw array.
|
|
|
106
124
|
|
|
107
125
|
#### Parameters
|
|
108
126
|
|
|
109
|
-
|
|
127
|
+
##### hex
|
|
128
|
+
|
|
129
|
+
`string`
|
|
110
130
|
|
|
111
131
|
The hex to decode.
|
|
112
132
|
|
|
113
|
-
|
|
133
|
+
##### reverse?
|
|
134
|
+
|
|
135
|
+
`boolean`
|
|
114
136
|
|
|
115
137
|
Store the characters in reverse.
|
|
116
138
|
|
|
@@ -130,11 +152,15 @@ Convert the UTF8 to hex.
|
|
|
130
152
|
|
|
131
153
|
#### Parameters
|
|
132
154
|
|
|
133
|
-
|
|
155
|
+
##### utf8
|
|
156
|
+
|
|
157
|
+
`string`
|
|
134
158
|
|
|
135
159
|
The text to convert.
|
|
136
160
|
|
|
137
|
-
|
|
161
|
+
##### includePrefix
|
|
162
|
+
|
|
163
|
+
`boolean` = `false`
|
|
138
164
|
|
|
139
165
|
Include the 0x prefix on the returned hex.
|
|
140
166
|
|
|
@@ -154,7 +180,9 @@ Convert the hex text to text.
|
|
|
154
180
|
|
|
155
181
|
#### Parameters
|
|
156
182
|
|
|
157
|
-
|
|
183
|
+
##### hex
|
|
184
|
+
|
|
185
|
+
`string`
|
|
158
186
|
|
|
159
187
|
The hex to convert.
|
|
160
188
|
|
|
@@ -174,7 +202,9 @@ Convert bytes to binary string.
|
|
|
174
202
|
|
|
175
203
|
#### Parameters
|
|
176
204
|
|
|
177
|
-
|
|
205
|
+
##### bytes
|
|
206
|
+
|
|
207
|
+
`Uint8Array`
|
|
178
208
|
|
|
179
209
|
The bytes to convert.
|
|
180
210
|
|
|
@@ -194,7 +224,9 @@ Convert a binary string to bytes.
|
|
|
194
224
|
|
|
195
225
|
#### Parameters
|
|
196
226
|
|
|
197
|
-
|
|
227
|
+
##### binary
|
|
228
|
+
|
|
229
|
+
`string`
|
|
198
230
|
|
|
199
231
|
The binary string.
|
|
200
232
|
|
|
@@ -214,7 +246,9 @@ Convert bytes to base64 string.
|
|
|
214
246
|
|
|
215
247
|
#### Parameters
|
|
216
248
|
|
|
217
|
-
|
|
249
|
+
##### bytes
|
|
250
|
+
|
|
251
|
+
`Uint8Array`
|
|
218
252
|
|
|
219
253
|
The bytes to convert.
|
|
220
254
|
|
|
@@ -234,7 +268,9 @@ Convert a base64 string to bytes.
|
|
|
234
268
|
|
|
235
269
|
#### Parameters
|
|
236
270
|
|
|
237
|
-
|
|
271
|
+
##### base64
|
|
272
|
+
|
|
273
|
+
`string`
|
|
238
274
|
|
|
239
275
|
The base64 string.
|
|
240
276
|
|
|
@@ -254,7 +290,9 @@ Convert bytes to base64 url string.
|
|
|
254
290
|
|
|
255
291
|
#### Parameters
|
|
256
292
|
|
|
257
|
-
|
|
293
|
+
##### bytes
|
|
294
|
+
|
|
295
|
+
`Uint8Array`
|
|
258
296
|
|
|
259
297
|
The bytes to convert.
|
|
260
298
|
|
|
@@ -274,7 +312,9 @@ Convert a base64 url string to bytes.
|
|
|
274
312
|
|
|
275
313
|
#### Parameters
|
|
276
314
|
|
|
277
|
-
|
|
315
|
+
##### base64Url
|
|
316
|
+
|
|
317
|
+
`string`
|
|
278
318
|
|
|
279
319
|
The base64 url string.
|
|
280
320
|
|
|
@@ -283,3 +323,47 @@ The base64 url string.
|
|
|
283
323
|
`Uint8Array`
|
|
284
324
|
|
|
285
325
|
The bytes.
|
|
326
|
+
|
|
327
|
+
***
|
|
328
|
+
|
|
329
|
+
### bytesToBase58()
|
|
330
|
+
|
|
331
|
+
> `static` **bytesToBase58**(`bytes`): `string`
|
|
332
|
+
|
|
333
|
+
Convert bytes to base58 string.
|
|
334
|
+
|
|
335
|
+
#### Parameters
|
|
336
|
+
|
|
337
|
+
##### bytes
|
|
338
|
+
|
|
339
|
+
`Uint8Array`
|
|
340
|
+
|
|
341
|
+
The bytes to convert.
|
|
342
|
+
|
|
343
|
+
#### Returns
|
|
344
|
+
|
|
345
|
+
`string`
|
|
346
|
+
|
|
347
|
+
A base58 string of the bytes.
|
|
348
|
+
|
|
349
|
+
***
|
|
350
|
+
|
|
351
|
+
### base58ToBytes()
|
|
352
|
+
|
|
353
|
+
> `static` **base58ToBytes**(`base58`): `Uint8Array`
|
|
354
|
+
|
|
355
|
+
Convert a base58 string to bytes.
|
|
356
|
+
|
|
357
|
+
#### Parameters
|
|
358
|
+
|
|
359
|
+
##### base58
|
|
360
|
+
|
|
361
|
+
`string`
|
|
362
|
+
|
|
363
|
+
The base58 string.
|
|
364
|
+
|
|
365
|
+
#### Returns
|
|
366
|
+
|
|
367
|
+
`Uint8Array`
|
|
368
|
+
|
|
369
|
+
The bytes.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Class: EnvHelper
|
|
2
|
+
|
|
3
|
+
Environment variable helper.
|
|
4
|
+
|
|
5
|
+
## Constructors
|
|
6
|
+
|
|
7
|
+
### new EnvHelper()
|
|
8
|
+
|
|
9
|
+
> **new EnvHelper**(): [`EnvHelper`](EnvHelper.md)
|
|
10
|
+
|
|
11
|
+
#### Returns
|
|
12
|
+
|
|
13
|
+
[`EnvHelper`](EnvHelper.md)
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
### envToJson()
|
|
18
|
+
|
|
19
|
+
> `static` **envToJson**\<`T`\>(`envVars`, `prefix`?): `T`
|
|
20
|
+
|
|
21
|
+
Get the environment variable as an object with camel cased names.
|
|
22
|
+
|
|
23
|
+
#### Type Parameters
|
|
24
|
+
|
|
25
|
+
• **T** = \{\}
|
|
26
|
+
|
|
27
|
+
#### Parameters
|
|
28
|
+
|
|
29
|
+
##### envVars
|
|
30
|
+
|
|
31
|
+
The environment variables.
|
|
32
|
+
|
|
33
|
+
##### prefix?
|
|
34
|
+
|
|
35
|
+
`string`
|
|
36
|
+
|
|
37
|
+
The prefix of the environment variables, if not provided gets all.
|
|
38
|
+
|
|
39
|
+
#### Returns
|
|
40
|
+
|
|
41
|
+
`T`
|
|
42
|
+
|
|
43
|
+
The object with camel cased names.
|
|
@@ -22,7 +22,9 @@ Format Errors and returns just their messages.
|
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### error
|
|
26
|
+
|
|
27
|
+
`unknown`
|
|
26
28
|
|
|
27
29
|
The error to format.
|
|
28
30
|
|
|
@@ -42,7 +44,9 @@ Localize the content of an error and any inner errors.
|
|
|
42
44
|
|
|
43
45
|
#### Parameters
|
|
44
46
|
|
|
45
|
-
|
|
47
|
+
##### error
|
|
48
|
+
|
|
49
|
+
`unknown`
|
|
46
50
|
|
|
47
51
|
The error to format.
|
|
48
52
|
|
|
@@ -62,7 +66,9 @@ Localize the content of an error and any inner errors.
|
|
|
62
66
|
|
|
63
67
|
#### Parameters
|
|
64
68
|
|
|
65
|
-
|
|
69
|
+
##### error
|
|
70
|
+
|
|
71
|
+
[`IError`](../interfaces/IError.md)
|
|
66
72
|
|
|
67
73
|
The error to format.
|
|
68
74
|
|