@twin.org/core 0.0.1-next.51 → 0.0.1-next.53
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 +225 -75
- package/dist/esm/index.mjs +225 -76
- package/dist/types/index.d.ts +2 -0
- package/dist/types/models/II18nShared.d.ts +29 -0
- package/dist/types/utils/asyncCache.d.ts +2 -1
- package/dist/types/utils/sharedStore.d.ts +23 -0
- package/docs/changelog.md +14 -0
- package/docs/reference/classes/AlreadyExistsError.md +7 -7
- package/docs/reference/classes/ArrayHelper.md +3 -3
- package/docs/reference/classes/AsyncCache.md +21 -9
- package/docs/reference/classes/Base32.md +3 -3
- package/docs/reference/classes/Base58.md +3 -3
- package/docs/reference/classes/Base64.md +3 -3
- package/docs/reference/classes/Base64Url.md +3 -3
- package/docs/reference/classes/BaseError.md +5 -5
- package/docs/reference/classes/BitString.md +5 -5
- package/docs/reference/classes/Coerce.md +7 -5
- package/docs/reference/classes/Compression.md +3 -3
- package/docs/reference/classes/ConflictError.md +7 -7
- package/docs/reference/classes/Converter.md +6 -6
- package/docs/reference/classes/EnvHelper.md +7 -5
- package/docs/reference/classes/ErrorHelper.md +3 -3
- package/docs/reference/classes/Factory.md +17 -7
- package/docs/reference/classes/FilenameHelper.md +3 -3
- package/docs/reference/classes/GeneralError.md +7 -7
- package/docs/reference/classes/GuardError.md +7 -7
- package/docs/reference/classes/Guards.md +18 -8
- package/docs/reference/classes/HexHelper.md +3 -3
- package/docs/reference/classes/I18n.md +6 -6
- package/docs/reference/classes/Is.md +21 -9
- package/docs/reference/classes/JsonHelper.md +10 -6
- package/docs/reference/classes/NotFoundError.md +7 -7
- package/docs/reference/classes/NotImplementedError.md +7 -7
- package/docs/reference/classes/NotSupportedError.md +7 -7
- package/docs/reference/classes/ObjectHelper.md +40 -18
- package/docs/reference/classes/RandomHelper.md +3 -3
- package/docs/reference/classes/SharedStore.md +94 -0
- package/docs/reference/classes/StringHelper.md +3 -3
- package/docs/reference/classes/Uint8ArrayHelper.md +3 -3
- package/docs/reference/classes/UnauthorizedError.md +7 -7
- package/docs/reference/classes/UnprocessableError.md +7 -7
- package/docs/reference/classes/Url.md +7 -7
- package/docs/reference/classes/Urn.md +9 -9
- package/docs/reference/classes/Validation.md +36 -28
- package/docs/reference/classes/ValidationError.md +7 -7
- package/docs/reference/index.md +2 -0
- package/docs/reference/interfaces/IComponent.md +3 -3
- package/docs/reference/interfaces/IError.md +1 -1
- package/docs/reference/interfaces/II18nShared.md +47 -0
- package/docs/reference/interfaces/IKeyValue.md +3 -1
- package/docs/reference/interfaces/ILabelledValue.md +3 -1
- package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
- package/docs/reference/type-aliases/CoerceType.md +1 -1
- package/docs/reference/type-aliases/CompressionType.md +1 -1
- package/package.json +2 -2
|
@@ -4,25 +4,27 @@ Cache the results from asynchronous requests.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new AsyncCache**():
|
|
9
|
+
> **new AsyncCache**(): `AsyncCache`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`AsyncCache`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### exec()
|
|
18
18
|
|
|
19
|
-
> `static` **exec**\<`T`\>(`key`, `ttlMs`, `requestMethod`): `undefined` \| `Promise`\<`T`\>
|
|
19
|
+
> `static` **exec**\<`T`\>(`key`, `ttlMs`, `requestMethod`, `cacheFailures?`): `undefined` \| `Promise`\<`T`\>
|
|
20
20
|
|
|
21
21
|
Execute an async request and cache the result.
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T` = `unknown`
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
@@ -44,6 +46,12 @@ The TTL of the entry in the cache.
|
|
|
44
46
|
|
|
45
47
|
The method to call if not cached.
|
|
46
48
|
|
|
49
|
+
##### cacheFailures?
|
|
50
|
+
|
|
51
|
+
`boolean`
|
|
52
|
+
|
|
53
|
+
Cache failure results, defaults to false.
|
|
54
|
+
|
|
47
55
|
#### Returns
|
|
48
56
|
|
|
49
57
|
`undefined` \| `Promise`\<`T`\>
|
|
@@ -60,7 +68,9 @@ Get an entry from the cache.
|
|
|
60
68
|
|
|
61
69
|
#### Type Parameters
|
|
62
70
|
|
|
63
|
-
|
|
71
|
+
##### T
|
|
72
|
+
|
|
73
|
+
`T` = `unknown`
|
|
64
74
|
|
|
65
75
|
#### Parameters
|
|
66
76
|
|
|
@@ -80,13 +90,15 @@ The item from the cache if it exists.
|
|
|
80
90
|
|
|
81
91
|
### set()
|
|
82
92
|
|
|
83
|
-
> `static` **set**\<`T`\>(`key`, `value`, `ttlMs
|
|
93
|
+
> `static` **set**\<`T`\>(`key`, `value`, `ttlMs?`): `Promise`\<`void`\>
|
|
84
94
|
|
|
85
95
|
Set an entry into the cache.
|
|
86
96
|
|
|
87
97
|
#### Type Parameters
|
|
88
98
|
|
|
89
|
-
|
|
99
|
+
##### T
|
|
100
|
+
|
|
101
|
+
`T` = `unknown`
|
|
90
102
|
|
|
91
103
|
#### Parameters
|
|
92
104
|
|
|
@@ -138,7 +150,7 @@ The key to remove from the cache.
|
|
|
138
150
|
|
|
139
151
|
### clearCache()
|
|
140
152
|
|
|
141
|
-
> `static` **clearCache**(`prefix
|
|
153
|
+
> `static` **clearCache**(`prefix?`): `void`
|
|
142
154
|
|
|
143
155
|
Clear the cache.
|
|
144
156
|
|
|
@@ -4,13 +4,13 @@ Class to help with base63 Encoding/Decoding.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Base32**():
|
|
9
|
+
> **new Base32**(): `Base32`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Base32`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -4,13 +4,13 @@ Class to help with base58 Encoding/Decoding.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Base58**():
|
|
9
|
+
> **new Base58**(): `Base58`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Base58`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -5,13 +5,13 @@ Sourced from https://github.com/beatgammit/base64-js.
|
|
|
5
5
|
|
|
6
6
|
## Constructors
|
|
7
7
|
|
|
8
|
-
###
|
|
8
|
+
### Constructor
|
|
9
9
|
|
|
10
|
-
> **new Base64**():
|
|
10
|
+
> **new Base64**(): `Base64`
|
|
11
11
|
|
|
12
12
|
#### Returns
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
`Base64`
|
|
15
15
|
|
|
16
16
|
## Methods
|
|
17
17
|
|
|
@@ -5,13 +5,13 @@ https://www.rfc-editor.org/rfc/rfc4648#section-5.
|
|
|
5
5
|
|
|
6
6
|
## Constructors
|
|
7
7
|
|
|
8
|
-
###
|
|
8
|
+
### Constructor
|
|
9
9
|
|
|
10
|
-
> **new Base64Url**():
|
|
10
|
+
> **new Base64Url**(): `Base64Url`
|
|
11
11
|
|
|
12
12
|
#### Returns
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
`Base64Url`
|
|
15
15
|
|
|
16
16
|
## Methods
|
|
17
17
|
|
|
@@ -25,9 +25,9 @@ Class to handle errors.
|
|
|
25
25
|
|
|
26
26
|
## Constructors
|
|
27
27
|
|
|
28
|
-
###
|
|
28
|
+
### Constructor
|
|
29
29
|
|
|
30
|
-
> **new BaseError**(`name`, `source`, `message`, `properties
|
|
30
|
+
> **new BaseError**(`name`, `source`, `message`, `properties?`, `inner?`): `BaseError`
|
|
31
31
|
|
|
32
32
|
Create a new instance of BaseError.
|
|
33
33
|
|
|
@@ -63,7 +63,7 @@ The inner error if we have wrapped another error.
|
|
|
63
63
|
|
|
64
64
|
#### Returns
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
`BaseError`
|
|
67
67
|
|
|
68
68
|
#### Overrides
|
|
69
69
|
|
|
@@ -113,7 +113,7 @@ The inner error if there was one.
|
|
|
113
113
|
|
|
114
114
|
### fromError()
|
|
115
115
|
|
|
116
|
-
> `static` **fromError**(`err`):
|
|
116
|
+
> `static` **fromError**(`err`): `BaseError`
|
|
117
117
|
|
|
118
118
|
Construct an error from an existing one.
|
|
119
119
|
|
|
@@ -127,7 +127,7 @@ The existing error.
|
|
|
127
127
|
|
|
128
128
|
#### Returns
|
|
129
129
|
|
|
130
|
-
|
|
130
|
+
`BaseError`
|
|
131
131
|
|
|
132
132
|
The new instance.
|
|
133
133
|
|
|
@@ -4,9 +4,9 @@ A class to represent a bit string.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new BitString**(`numberBits`):
|
|
9
|
+
> **new BitString**(`numberBits`): `BitString`
|
|
10
10
|
|
|
11
11
|
Create a new instance of BitString.
|
|
12
12
|
|
|
@@ -20,13 +20,13 @@ The length of the bit string.
|
|
|
20
20
|
|
|
21
21
|
#### Returns
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
`BitString`
|
|
24
24
|
|
|
25
25
|
## Methods
|
|
26
26
|
|
|
27
27
|
### fromBits()
|
|
28
28
|
|
|
29
|
-
> `static` **fromBits**(`bits`, `numberBits`):
|
|
29
|
+
> `static` **fromBits**(`bits`, `numberBits`): `BitString`
|
|
30
30
|
|
|
31
31
|
Create a new instance of BitString from a bit array.
|
|
32
32
|
|
|
@@ -46,7 +46,7 @@ The number of bits in the bit string.
|
|
|
46
46
|
|
|
47
47
|
#### Returns
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
`BitString`
|
|
50
50
|
|
|
51
51
|
The new instance of BitString.
|
|
52
52
|
|
|
@@ -4,13 +4,13 @@ Coerce an object from one type to another.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Coerce**():
|
|
9
|
+
> **new Coerce**(): `Coerce`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Coerce`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -230,7 +230,9 @@ Coerce the value to an object.
|
|
|
230
230
|
|
|
231
231
|
#### Type Parameters
|
|
232
232
|
|
|
233
|
-
|
|
233
|
+
##### T
|
|
234
|
+
|
|
235
|
+
`T` = `unknown`
|
|
234
236
|
|
|
235
237
|
#### Parameters
|
|
236
238
|
|
|
@@ -280,7 +282,7 @@ TypeError If the value can not be coerced.
|
|
|
280
282
|
|
|
281
283
|
### byType()
|
|
282
284
|
|
|
283
|
-
> `static` **byType**(`value`, `type
|
|
285
|
+
> `static` **byType**(`value`, `type?`): `unknown`
|
|
284
286
|
|
|
285
287
|
Coerces a value based on the coercion type.
|
|
286
288
|
|
|
@@ -4,13 +4,13 @@ A class to handle compression.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Compression**():
|
|
9
|
+
> **new Compression**(): `Compression`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Compression`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -8,9 +8,9 @@ Class to handle errors which are triggered by conflicting data.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new ConflictError**(`source`, `message`, `conflictId
|
|
13
|
+
> **new ConflictError**(`source`, `message`, `conflictId?`, `conflicts?`, `inner?`): `ConflictError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of ConflictError.
|
|
16
16
|
|
|
@@ -48,11 +48,11 @@ The inner error if we have wrapped another error.
|
|
|
48
48
|
|
|
49
49
|
#### Returns
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
`ConflictError`
|
|
52
52
|
|
|
53
53
|
#### Overrides
|
|
54
54
|
|
|
55
|
-
[`BaseError`](BaseError.md).[`constructor`](BaseError.md#
|
|
55
|
+
[`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructor)
|
|
56
56
|
|
|
57
57
|
## Properties
|
|
58
58
|
|
|
@@ -64,7 +64,7 @@ The source of the error.
|
|
|
64
64
|
|
|
65
65
|
#### Inherited from
|
|
66
66
|
|
|
67
|
-
[`BaseError`](BaseError.md).[`source`](BaseError.md#source
|
|
67
|
+
[`BaseError`](BaseError.md).[`source`](BaseError.md#source)
|
|
68
68
|
|
|
69
69
|
***
|
|
70
70
|
|
|
@@ -80,7 +80,7 @@ Any additional information for the error.
|
|
|
80
80
|
|
|
81
81
|
#### Inherited from
|
|
82
82
|
|
|
83
|
-
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties
|
|
83
|
+
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
|
|
84
84
|
|
|
85
85
|
***
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ The inner error if there was one.
|
|
|
92
92
|
|
|
93
93
|
#### Inherited from
|
|
94
94
|
|
|
95
|
-
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner
|
|
95
|
+
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
|
|
96
96
|
|
|
97
97
|
***
|
|
98
98
|
|
|
@@ -4,19 +4,19 @@ Convert arrays to and from different formats.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Converter**():
|
|
9
|
+
> **new Converter**(): `Converter`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Converter`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### bytesToUtf8()
|
|
18
18
|
|
|
19
|
-
> `static` **bytesToUtf8**(`array`, `startIndex
|
|
19
|
+
> `static` **bytesToUtf8**(`array`, `startIndex?`, `length?`): `string`
|
|
20
20
|
|
|
21
21
|
Encode a raw array to UTF8 string.
|
|
22
22
|
|
|
@@ -72,7 +72,7 @@ The array.
|
|
|
72
72
|
|
|
73
73
|
### bytesToHex()
|
|
74
74
|
|
|
75
|
-
> `static` **bytesToHex**(`array`, `includePrefix`, `startIndex
|
|
75
|
+
> `static` **bytesToHex**(`array`, `includePrefix`, `startIndex?`, `length?`, `reverse?`): `string`
|
|
76
76
|
|
|
77
77
|
Encode a raw array to hex string.
|
|
78
78
|
|
|
@@ -118,7 +118,7 @@ The array formatted as hex.
|
|
|
118
118
|
|
|
119
119
|
### hexToBytes()
|
|
120
120
|
|
|
121
|
-
> `static` **hexToBytes**(`hex`, `reverse
|
|
121
|
+
> `static` **hexToBytes**(`hex`, `reverse?`): `Uint8Array`
|
|
122
122
|
|
|
123
123
|
Decode a hex string to raw array.
|
|
124
124
|
|
|
@@ -4,25 +4,27 @@ Environment variable helper.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new EnvHelper**():
|
|
9
|
+
> **new EnvHelper**(): `EnvHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`EnvHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
17
17
|
### envToJson()
|
|
18
18
|
|
|
19
|
-
> `static` **envToJson**\<`T`\>(`envVars`, `prefix
|
|
19
|
+
> `static` **envToJson**\<`T`\>(`envVars`, `prefix?`): `T`
|
|
20
20
|
|
|
21
21
|
Get the environment variable as an object with camel cased names.
|
|
22
22
|
|
|
23
23
|
#### Type Parameters
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
##### T
|
|
26
|
+
|
|
27
|
+
`T` = \{[`id`: `string`]: `string`; \}
|
|
26
28
|
|
|
27
29
|
#### Parameters
|
|
28
30
|
|
|
@@ -4,13 +4,13 @@ Error helper functions.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new ErrorHelper**():
|
|
9
|
+
> **new ErrorHelper**(): `ErrorHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`ErrorHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -4,19 +4,23 @@ Factory for creating implementation of generic types.
|
|
|
4
4
|
|
|
5
5
|
## Type Parameters
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
### T
|
|
8
|
+
|
|
9
|
+
`T`
|
|
8
10
|
|
|
9
11
|
## Methods
|
|
10
12
|
|
|
11
13
|
### createFactory()
|
|
12
14
|
|
|
13
|
-
> `static` **createFactory**\<`U`\>(`typeName`, `autoInstance`, `matcher
|
|
15
|
+
> `static` **createFactory**\<`U`\>(`typeName`, `autoInstance`, `matcher?`): `Factory`\<`U`\>
|
|
14
16
|
|
|
15
17
|
Create a new factory, which is shared throughout all library instances.
|
|
16
18
|
|
|
17
19
|
#### Type Parameters
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
##### U
|
|
22
|
+
|
|
23
|
+
`U`
|
|
20
24
|
|
|
21
25
|
#### Parameters
|
|
22
26
|
|
|
@@ -40,7 +44,7 @@ Match the name of the instance.
|
|
|
40
44
|
|
|
41
45
|
#### Returns
|
|
42
46
|
|
|
43
|
-
|
|
47
|
+
`Factory`\<`U`\>
|
|
44
48
|
|
|
45
49
|
The factory instance.
|
|
46
50
|
|
|
@@ -92,7 +96,9 @@ Register a new generator.
|
|
|
92
96
|
|
|
93
97
|
#### Type Parameters
|
|
94
98
|
|
|
95
|
-
|
|
99
|
+
##### U
|
|
100
|
+
|
|
101
|
+
`U`
|
|
96
102
|
|
|
97
103
|
#### Parameters
|
|
98
104
|
|
|
@@ -150,7 +156,9 @@ Get a generator instance.
|
|
|
150
156
|
|
|
151
157
|
#### Type Parameters
|
|
152
158
|
|
|
153
|
-
|
|
159
|
+
##### U
|
|
160
|
+
|
|
161
|
+
`U`
|
|
154
162
|
|
|
155
163
|
#### Parameters
|
|
156
164
|
|
|
@@ -184,7 +192,9 @@ Get a generator instance with no exceptions.
|
|
|
184
192
|
|
|
185
193
|
#### Type Parameters
|
|
186
194
|
|
|
187
|
-
|
|
195
|
+
##### U
|
|
196
|
+
|
|
197
|
+
`U`
|
|
188
198
|
|
|
189
199
|
#### Parameters
|
|
190
200
|
|
|
@@ -4,13 +4,13 @@ Class to help with filenames.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new FilenameHelper**():
|
|
9
|
+
> **new FilenameHelper**(): `FilenameHelper`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`FilenameHelper`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -8,9 +8,9 @@ Class to handle errors.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new GeneralError**(`source`, `message`, `properties
|
|
13
|
+
> **new GeneralError**(`source`, `message`, `properties?`, `inner?`): `GeneralError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of GeneralError.
|
|
16
16
|
|
|
@@ -40,11 +40,11 @@ The inner error if we have wrapped another error.
|
|
|
40
40
|
|
|
41
41
|
#### Returns
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
`GeneralError`
|
|
44
44
|
|
|
45
45
|
#### Overrides
|
|
46
46
|
|
|
47
|
-
[`BaseError`](BaseError.md).[`constructor`](BaseError.md#
|
|
47
|
+
[`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructor)
|
|
48
48
|
|
|
49
49
|
## Properties
|
|
50
50
|
|
|
@@ -56,7 +56,7 @@ The source of the error.
|
|
|
56
56
|
|
|
57
57
|
#### Inherited from
|
|
58
58
|
|
|
59
|
-
[`BaseError`](BaseError.md).[`source`](BaseError.md#source
|
|
59
|
+
[`BaseError`](BaseError.md).[`source`](BaseError.md#source)
|
|
60
60
|
|
|
61
61
|
***
|
|
62
62
|
|
|
@@ -72,7 +72,7 @@ Any additional information for the error.
|
|
|
72
72
|
|
|
73
73
|
#### Inherited from
|
|
74
74
|
|
|
75
|
-
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties
|
|
75
|
+
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
|
|
76
76
|
|
|
77
77
|
***
|
|
78
78
|
|
|
@@ -84,7 +84,7 @@ The inner error if there was one.
|
|
|
84
84
|
|
|
85
85
|
#### Inherited from
|
|
86
86
|
|
|
87
|
-
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner
|
|
87
|
+
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
|
|
88
88
|
|
|
89
89
|
***
|
|
90
90
|
|
|
@@ -8,9 +8,9 @@ Class to handle errors which are triggered by data guards.
|
|
|
8
8
|
|
|
9
9
|
## Constructors
|
|
10
10
|
|
|
11
|
-
###
|
|
11
|
+
### Constructor
|
|
12
12
|
|
|
13
|
-
> **new GuardError**(`source`, `message`, `propertyName`, `propertyValue`, `propertyOptions
|
|
13
|
+
> **new GuardError**(`source`, `message`, `propertyName`, `propertyValue`, `propertyOptions?`): `GuardError`
|
|
14
14
|
|
|
15
15
|
Create a new instance of GuardError.
|
|
16
16
|
|
|
@@ -48,11 +48,11 @@ The property options which might be allowed.
|
|
|
48
48
|
|
|
49
49
|
#### Returns
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
`GuardError`
|
|
52
52
|
|
|
53
53
|
#### Overrides
|
|
54
54
|
|
|
55
|
-
[`BaseError`](BaseError.md).[`constructor`](BaseError.md#
|
|
55
|
+
[`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructor)
|
|
56
56
|
|
|
57
57
|
## Properties
|
|
58
58
|
|
|
@@ -64,7 +64,7 @@ The source of the error.
|
|
|
64
64
|
|
|
65
65
|
#### Inherited from
|
|
66
66
|
|
|
67
|
-
[`BaseError`](BaseError.md).[`source`](BaseError.md#source
|
|
67
|
+
[`BaseError`](BaseError.md).[`source`](BaseError.md#source)
|
|
68
68
|
|
|
69
69
|
***
|
|
70
70
|
|
|
@@ -80,7 +80,7 @@ Any additional information for the error.
|
|
|
80
80
|
|
|
81
81
|
#### Inherited from
|
|
82
82
|
|
|
83
|
-
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties
|
|
83
|
+
[`BaseError`](BaseError.md).[`properties`](BaseError.md#properties)
|
|
84
84
|
|
|
85
85
|
***
|
|
86
86
|
|
|
@@ -92,7 +92,7 @@ The inner error if there was one.
|
|
|
92
92
|
|
|
93
93
|
#### Inherited from
|
|
94
94
|
|
|
95
|
-
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner
|
|
95
|
+
[`BaseError`](BaseError.md).[`inner`](BaseError.md#inner)
|
|
96
96
|
|
|
97
97
|
***
|
|
98
98
|
|
|
@@ -4,13 +4,13 @@ Class to handle guard operations for parameters.
|
|
|
4
4
|
|
|
5
5
|
## Constructors
|
|
6
6
|
|
|
7
|
-
###
|
|
7
|
+
### Constructor
|
|
8
8
|
|
|
9
|
-
> **new Guards**():
|
|
9
|
+
> **new Guards**(): `Guards`
|
|
10
10
|
|
|
11
11
|
#### Returns
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
`Guards`
|
|
14
14
|
|
|
15
15
|
## Methods
|
|
16
16
|
|
|
@@ -616,7 +616,9 @@ Is the property an object.
|
|
|
616
616
|
|
|
617
617
|
#### Type Parameters
|
|
618
618
|
|
|
619
|
-
|
|
619
|
+
##### T
|
|
620
|
+
|
|
621
|
+
`T` = \{[`id`: `string`]: `unknown`; \}
|
|
620
622
|
|
|
621
623
|
#### Parameters
|
|
622
624
|
|
|
@@ -656,7 +658,9 @@ Is the property is an object with at least one property.
|
|
|
656
658
|
|
|
657
659
|
#### Type Parameters
|
|
658
660
|
|
|
659
|
-
|
|
661
|
+
##### T
|
|
662
|
+
|
|
663
|
+
`T` = \{[`id`: `string`]: `unknown`; \}
|
|
660
664
|
|
|
661
665
|
#### Parameters
|
|
662
666
|
|
|
@@ -696,7 +700,9 @@ Is the property is an array.
|
|
|
696
700
|
|
|
697
701
|
#### Type Parameters
|
|
698
702
|
|
|
699
|
-
|
|
703
|
+
##### T
|
|
704
|
+
|
|
705
|
+
`T`
|
|
700
706
|
|
|
701
707
|
#### Parameters
|
|
702
708
|
|
|
@@ -736,7 +742,9 @@ Is the property is an array with at least one item.
|
|
|
736
742
|
|
|
737
743
|
#### Type Parameters
|
|
738
744
|
|
|
739
|
-
|
|
745
|
+
##### T
|
|
746
|
+
|
|
747
|
+
`T`
|
|
740
748
|
|
|
741
749
|
#### Parameters
|
|
742
750
|
|
|
@@ -776,7 +784,9 @@ Is the property one of a list of items.
|
|
|
776
784
|
|
|
777
785
|
#### Type Parameters
|
|
778
786
|
|
|
779
|
-
|
|
787
|
+
##### T
|
|
788
|
+
|
|
789
|
+
`T`
|
|
780
790
|
|
|
781
791
|
#### Parameters
|
|
782
792
|
|