@twin.org/core 0.0.1-next.9 → 0.0.1

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.
Files changed (77) hide show
  1. package/dist/cjs/index.cjs +1564 -834
  2. package/dist/esm/index.mjs +1561 -835
  3. package/dist/types/errors/baseError.d.ts +2 -1
  4. package/dist/types/factories/factory.d.ts +20 -1
  5. package/dist/types/helpers/arrayHelper.d.ts +13 -0
  6. package/dist/types/helpers/envHelper.d.ts +16 -0
  7. package/dist/types/helpers/errorHelper.d.ts +2 -1
  8. package/dist/types/helpers/jsonHelper.d.ts +30 -0
  9. package/dist/types/helpers/objectHelper.d.ts +25 -0
  10. package/dist/types/helpers/uint8ArrayHelper.d.ts +11 -0
  11. package/dist/types/index.d.ts +6 -0
  12. package/dist/types/models/IComponent.d.ts +12 -3
  13. package/dist/types/models/II18nShared.d.ts +29 -0
  14. package/dist/types/models/coerceType.d.ts +49 -0
  15. package/dist/types/models/compressionType.d.ts +1 -1
  16. package/dist/types/models/objectOrArray.d.ts +4 -0
  17. package/dist/types/utils/asyncCache.d.ts +10 -1
  18. package/dist/types/utils/coerce.d.ts +22 -0
  19. package/dist/types/utils/guards.d.ts +35 -0
  20. package/dist/types/utils/is.d.ts +12 -0
  21. package/dist/types/utils/sharedStore.d.ts +23 -0
  22. package/dist/types/utils/validation.d.ts +2 -0
  23. package/docs/changelog.md +230 -1
  24. package/docs/reference/classes/AlreadyExistsError.md +77 -27
  25. package/docs/reference/classes/ArrayHelper.md +79 -5
  26. package/docs/reference/classes/AsyncCache.md +75 -13
  27. package/docs/reference/classes/Base32.md +9 -5
  28. package/docs/reference/classes/Base58.md +9 -5
  29. package/docs/reference/classes/Base64.md +12 -6
  30. package/docs/reference/classes/Base64Url.md +9 -5
  31. package/docs/reference/classes/BaseError.md +79 -29
  32. package/docs/reference/classes/BitString.md +23 -11
  33. package/docs/reference/classes/Coerce.md +110 -12
  34. package/docs/reference/classes/Compression.md +19 -11
  35. package/docs/reference/classes/ConflictError.md +80 -28
  36. package/docs/reference/classes/Converter.md +72 -28
  37. package/docs/reference/classes/EnvHelper.md +45 -0
  38. package/docs/reference/classes/ErrorHelper.md +19 -7
  39. package/docs/reference/classes/Factory.md +95 -17
  40. package/docs/reference/classes/FilenameHelper.md +6 -4
  41. package/docs/reference/classes/GeneralError.md +75 -27
  42. package/docs/reference/classes/GuardError.md +80 -28
  43. package/docs/reference/classes/Guards.md +398 -80
  44. package/docs/reference/classes/HexHelper.md +18 -8
  45. package/docs/reference/classes/I18n.md +46 -20
  46. package/docs/reference/classes/Is.md +179 -51
  47. package/docs/reference/classes/JsonHelper.md +146 -10
  48. package/docs/reference/classes/NotFoundError.md +77 -27
  49. package/docs/reference/classes/NotImplementedError.md +71 -25
  50. package/docs/reference/classes/NotSupportedError.md +74 -26
  51. package/docs/reference/classes/ObjectHelper.md +197 -39
  52. package/docs/reference/classes/RandomHelper.md +6 -4
  53. package/docs/reference/classes/SharedStore.md +94 -0
  54. package/docs/reference/classes/StringHelper.md +54 -20
  55. package/docs/reference/classes/Uint8ArrayHelper.md +35 -0
  56. package/docs/reference/classes/UnauthorizedError.md +74 -26
  57. package/docs/reference/classes/UnprocessableError.md +75 -27
  58. package/docs/reference/classes/Url.md +37 -17
  59. package/docs/reference/classes/Urn.md +63 -27
  60. package/docs/reference/classes/Validation.md +349 -135
  61. package/docs/reference/classes/ValidationError.md +74 -26
  62. package/docs/reference/index.md +7 -0
  63. package/docs/reference/interfaces/IComponent.md +30 -8
  64. package/docs/reference/interfaces/IError.md +2 -2
  65. package/docs/reference/interfaces/II18nShared.md +47 -0
  66. package/docs/reference/interfaces/IKeyValue.md +3 -1
  67. package/docs/reference/interfaces/ILabelledValue.md +3 -1
  68. package/docs/reference/interfaces/ILocaleDictionary.md +1 -1
  69. package/docs/reference/interfaces/IPatchOperation.md +1 -1
  70. package/docs/reference/interfaces/IValidationFailure.md +1 -1
  71. package/docs/reference/type-aliases/CoerceType.md +5 -0
  72. package/docs/reference/type-aliases/CompressionType.md +1 -1
  73. package/docs/reference/type-aliases/ObjectOrArray.md +11 -0
  74. package/docs/reference/variables/CoerceType.md +67 -0
  75. package/docs/reference/variables/CompressionType.md +1 -1
  76. package/locales/en.json +14 -1
  77. package/package.json +7 -7
package/docs/changelog.md CHANGED
@@ -1,5 +1,234 @@
1
1
  # @twin.org/core - Changelog
2
2
 
3
- ## 0.0.1-next.9
3
+ ## 0.0.1 (2025-07-03)
4
+
5
+
6
+ ### Features
7
+
8
+ * release to production ([829d53d](https://github.com/twinfoundation/framework/commit/829d53d3953b1e1b40b0243c04cfdfd3842aac7b))
9
+ * release to production ([5cf3a76](https://github.com/twinfoundation/framework/commit/5cf3a76a09eff2e6414d0cba846c7c37400a11d6))
10
+
11
+
12
+ ### Dependencies
13
+
14
+ * The following workspace dependencies were updated
15
+ * dependencies
16
+ * @twin.org/nameof bumped from ^0.0.0 to ^0.0.1
17
+ * devDependencies
18
+ * @twin.org/nameof-transformer bumped from ^0.0.0 to ^0.0.1
19
+ * @twin.org/nameof-vitest-plugin bumped from ^0.0.0 to ^0.0.1
20
+
21
+ ## [0.0.1-next.70](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.69...core-v0.0.1-next.70) (2025-07-02)
22
+
23
+
24
+ ### Features
25
+
26
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
27
+ * add ObjectOrArray and ArrayHelper methods ([0ac9077](https://github.com/twinfoundation/framework/commit/0ac907764d64b38ad1b04b0e9c3027055b527559))
28
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
29
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
30
+ * async cache don't cache failures unless requested ([658ec4b](https://github.com/twinfoundation/framework/commit/658ec4b67a58a075de4702a3886d151e25ad3ddc))
31
+ * improve base error data extraction ([dccc933](https://github.com/twinfoundation/framework/commit/dccc93361a1544b41db0e7c126ff90e858d87960))
32
+ * improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
33
+ * propagate includeStackTrace on error conversion ([8471cbb](https://github.com/twinfoundation/framework/commit/8471cbb71f8fc98247a0e92126c438c1a8b04d9b))
34
+ * propagate includeStackTrace on error conversion ([818337d](https://github.com/twinfoundation/framework/commit/818337d50d14bf5a7e8b3204649aa7527115cca9))
35
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
36
+ * simplify async set ([#121](https://github.com/twinfoundation/framework/issues/121)) ([2693c32](https://github.com/twinfoundation/framework/commit/2693c325266fd1a0aede6f1336c8b254c981a9ca))
37
+ * support indexed properties set in objects ([b9c001d](https://github.com/twinfoundation/framework/commit/b9c001dc4614f6ff7486f4370735a553613d823a))
38
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
39
+
40
+
41
+ ### Dependencies
42
+
43
+ * The following workspace dependencies were updated
44
+ * dependencies
45
+ * @twin.org/nameof bumped from 0.0.1-next.69 to 0.0.1-next.70
46
+ * devDependencies
47
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.69 to 0.0.1-next.70
48
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.69 to 0.0.1-next.70
49
+
50
+ ## [0.0.1-next.69](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.68...core-v0.0.1-next.69) (2025-07-02)
51
+
52
+
53
+ ### Features
54
+
55
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
56
+ * add ObjectOrArray and ArrayHelper methods ([0ac9077](https://github.com/twinfoundation/framework/commit/0ac907764d64b38ad1b04b0e9c3027055b527559))
57
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
58
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
59
+ * async cache don't cache failures unless requested ([658ec4b](https://github.com/twinfoundation/framework/commit/658ec4b67a58a075de4702a3886d151e25ad3ddc))
60
+ * improve base error data extraction ([dccc933](https://github.com/twinfoundation/framework/commit/dccc93361a1544b41db0e7c126ff90e858d87960))
61
+ * improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
62
+ * propagate includeStackTrace on error conversion ([8471cbb](https://github.com/twinfoundation/framework/commit/8471cbb71f8fc98247a0e92126c438c1a8b04d9b))
63
+ * propagate includeStackTrace on error conversion ([818337d](https://github.com/twinfoundation/framework/commit/818337d50d14bf5a7e8b3204649aa7527115cca9))
64
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
65
+ * simplify async set ([#121](https://github.com/twinfoundation/framework/issues/121)) ([2693c32](https://github.com/twinfoundation/framework/commit/2693c325266fd1a0aede6f1336c8b254c981a9ca))
66
+ * support indexed properties set in objects ([b9c001d](https://github.com/twinfoundation/framework/commit/b9c001dc4614f6ff7486f4370735a553613d823a))
67
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
68
+
69
+
70
+ ### Dependencies
71
+
72
+ * The following workspace dependencies were updated
73
+ * dependencies
74
+ * @twin.org/nameof bumped from 0.0.1-next.68 to 0.0.1-next.69
75
+ * devDependencies
76
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.68 to 0.0.1-next.69
77
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.68 to 0.0.1-next.69
78
+
79
+ ## [0.0.1-next.68](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.67...core-v0.0.1-next.68) (2025-07-02)
80
+
81
+
82
+ ### Features
83
+
84
+ * relocate core packages from tools ([bcab8f3](https://github.com/twinfoundation/framework/commit/bcab8f3160442ea4fcaf442947462504f3d6a17d))
85
+
86
+
87
+ ### Dependencies
88
+
89
+ * The following workspace dependencies were updated
90
+ * dependencies
91
+ * @twin.org/nameof bumped from 0.0.1-next.67 to 0.0.1-next.68
92
+ * devDependencies
93
+ * @twin.org/nameof-transformer bumped from 0.0.1-next.67 to 0.0.1-next.68
94
+ * @twin.org/nameof-vitest-plugin bumped from 0.0.1-next.67 to 0.0.1-next.68
95
+
96
+ ## [0.0.1-next.67](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.66...core-v0.0.1-next.67) (2025-06-26)
97
+
98
+
99
+ ### Miscellaneous Chores
100
+
101
+ * **core:** Synchronize repo versions
102
+
103
+ ## [0.0.1-next.66](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.65...core-v0.0.1-next.66) (2025-06-26)
104
+
105
+
106
+ ### Features
107
+
108
+ * improve base error data extraction ([dccc933](https://github.com/twinfoundation/framework/commit/dccc93361a1544b41db0e7c126ff90e858d87960))
109
+
110
+ ## [0.0.1-next.65](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.64...core-v0.0.1-next.65) (2025-06-19)
111
+
112
+
113
+ ### Miscellaneous Chores
114
+
115
+ * **core:** Synchronize repo versions
116
+
117
+ ## [0.0.1-next.64](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.63...core-v0.0.1-next.64) (2025-06-19)
118
+
119
+
120
+ ### Features
121
+
122
+ * add zlib/deflate mime types detection ([72c472b](https://github.com/twinfoundation/framework/commit/72c472b5a35a973e7109336f5b6cdd84dbb8bbcb))
123
+
124
+ ## [0.0.1-next.63](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.62...core-v0.0.1-next.63) (2025-06-18)
125
+
126
+
127
+ ### Miscellaneous Chores
128
+
129
+ * **core:** Synchronize repo versions
130
+
131
+ ## [0.0.1-next.62](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.61...core-v0.0.1-next.62) (2025-06-17)
132
+
133
+
134
+ ### Features
135
+
136
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
137
+ * add ObjectOrArray and ArrayHelper methods ([0ac9077](https://github.com/twinfoundation/framework/commit/0ac907764d64b38ad1b04b0e9c3027055b527559))
138
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
139
+ * async cache don't cache failures unless requested ([658ec4b](https://github.com/twinfoundation/framework/commit/658ec4b67a58a075de4702a3886d151e25ad3ddc))
140
+ * improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
141
+ * propagate includeStackTrace on error conversion ([8471cbb](https://github.com/twinfoundation/framework/commit/8471cbb71f8fc98247a0e92126c438c1a8b04d9b))
142
+ * propagate includeStackTrace on error conversion ([818337d](https://github.com/twinfoundation/framework/commit/818337d50d14bf5a7e8b3204649aa7527115cca9))
143
+ * simplify async set ([#121](https://github.com/twinfoundation/framework/issues/121)) ([2693c32](https://github.com/twinfoundation/framework/commit/2693c325266fd1a0aede6f1336c8b254c981a9ca))
144
+ * support indexed properties set in objects ([b9c001d](https://github.com/twinfoundation/framework/commit/b9c001dc4614f6ff7486f4370735a553613d823a))
145
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
146
+
147
+ ## [0.0.1-next.61](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.60...core-v0.0.1-next.61) (2025-06-17)
148
+
149
+
150
+ ### Features
151
+
152
+ * support indexed properties set in objects ([b9c001d](https://github.com/twinfoundation/framework/commit/b9c001dc4614f6ff7486f4370735a553613d823a))
153
+
154
+ ## [0.0.1-next.60](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.59...core-v0.0.1-next.60) (2025-06-17)
155
+
156
+
157
+ ### Features
158
+
159
+ * improve error display in CLI ([94b6ca8](https://github.com/twinfoundation/framework/commit/94b6ca8bdcfe3ca7671c4095b436ea7bddaae98e))
160
+
161
+ ## [0.0.1-next.59](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.58...core-v0.0.1-next.59) (2025-06-17)
162
+
163
+
164
+ ### Features
165
+
166
+ * propagate includeStackTrace on error conversion ([8471cbb](https://github.com/twinfoundation/framework/commit/8471cbb71f8fc98247a0e92126c438c1a8b04d9b))
167
+ * propagate includeStackTrace on error conversion ([818337d](https://github.com/twinfoundation/framework/commit/818337d50d14bf5a7e8b3204649aa7527115cca9))
168
+
169
+ ## [0.0.1-next.58](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.57...core-v0.0.1-next.58) (2025-06-13)
170
+
171
+
172
+ ### Miscellaneous Chores
173
+
174
+ * **core:** Synchronize repo versions
175
+
176
+ ## [0.0.1-next.57](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.56...core-v0.0.1-next.57) (2025-06-10)
177
+
178
+
179
+ ### Features
180
+
181
+ * add guards arrayEndsWith and arrayStartsWith ([95d875e](https://github.com/twinfoundation/framework/commit/95d875ec8ccb4713c145fdde941d4cfedcec2ed3))
182
+
183
+ ## [0.0.1-next.56](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.55...core-v0.0.1-next.56) (2025-05-08)
184
+
185
+
186
+ ### Features
187
+
188
+ * add ObjectOrArray and ArrayHelper methods ([0ac9077](https://github.com/twinfoundation/framework/commit/0ac907764d64b38ad1b04b0e9c3027055b527559))
189
+
190
+ ## [0.0.1-next.55](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.54...core-v0.0.1-next.55) (2025-05-07)
191
+
192
+
193
+ ### Miscellaneous Chores
194
+
195
+ * **core:** Synchronize repo versions
196
+
197
+ ## [0.0.1-next.54](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.53...core-v0.0.1-next.54) (2025-05-06)
198
+
199
+
200
+ ### Miscellaneous Chores
201
+
202
+ * **core:** Synchronize repo versions
203
+
204
+ ## [0.0.1-next.53](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.52...core-v0.0.1-next.53) (2025-05-01)
205
+
206
+
207
+ ### Features
208
+
209
+ * async cache don't cache failures unless requested ([658ec4b](https://github.com/twinfoundation/framework/commit/658ec4b67a58a075de4702a3886d151e25ad3ddc))
210
+
211
+ ## [0.0.1-next.52](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.51...core-v0.0.1-next.52) (2025-04-17)
212
+
213
+
214
+ ### Features
215
+
216
+ * use new shared store mechanism ([#131](https://github.com/twinfoundation/framework/issues/131)) ([934385b](https://github.com/twinfoundation/framework/commit/934385b2fbaf9f5c00a505ebf9d093bd5a425f55))
217
+
218
+ ## [0.0.1-next.51](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.50...core-v0.0.1-next.51) (2025-03-27)
219
+
220
+
221
+ ### Features
222
+
223
+ * simplify async set ([#121](https://github.com/twinfoundation/framework/issues/121)) ([2693c32](https://github.com/twinfoundation/framework/commit/2693c325266fd1a0aede6f1336c8b254c981a9ca))
224
+
225
+ ## [0.0.1-next.50](https://github.com/twinfoundation/framework/compare/core-v0.0.1-next.49...core-v0.0.1-next.50) (2025-03-26)
226
+
227
+
228
+ ### Features
229
+
230
+ * add set method for async caches ([ba34b55](https://github.com/twinfoundation/framework/commit/ba34b55e651ad56ab8fc59e139e4af631c19cda0))
231
+
232
+ ## 0.0.1-next.49
4
233
 
5
234
  - Initial Release
@@ -8,37 +8,45 @@ Class to handle errors which are triggered by data already existing.
8
8
 
9
9
  ## Constructors
10
10
 
11
- ### new AlreadyExistsError()
11
+ ### Constructor
12
12
 
13
- > **new AlreadyExistsError**(`source`, `message`, `existingId`?, `inner`?): [`AlreadyExistsError`](AlreadyExistsError.md)
13
+ > **new AlreadyExistsError**(`source`, `message`, `existingId?`, `inner?`): `AlreadyExistsError`
14
14
 
15
15
  Create a new instance of AlreadyExistsError.
16
16
 
17
17
  #### Parameters
18
18
 
19
- **source**: `string`
19
+ ##### source
20
+
21
+ `string`
20
22
 
21
23
  The source of the error.
22
24
 
23
- **message**: `string`
25
+ ##### message
26
+
27
+ `string`
24
28
 
25
29
  The message as a code.
26
30
 
27
- **existingId?**: `string`
31
+ ##### existingId?
32
+
33
+ `string`
28
34
 
29
35
  The id for the item.
30
36
 
31
- **inner?**: `unknown`
37
+ ##### inner?
38
+
39
+ `unknown`
32
40
 
33
41
  The inner error if we have wrapped another error.
34
42
 
35
43
  #### Returns
36
44
 
37
- [`AlreadyExistsError`](AlreadyExistsError.md)
45
+ `AlreadyExistsError`
38
46
 
39
47
  #### Overrides
40
48
 
41
- [`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructors)
49
+ [`BaseError`](BaseError.md).[`constructor`](BaseError.md#constructor)
42
50
 
43
51
  ## Properties
44
52
 
@@ -70,7 +78,7 @@ Any additional information for the error.
70
78
 
71
79
  #### Index Signature
72
80
 
73
- \[`id`: `string`\]: `unknown`
81
+ \[`id`: `string`\]: `unknown`
74
82
 
75
83
  #### Inherited from
76
84
 
@@ -98,7 +106,9 @@ Construct an error from an existing one.
98
106
 
99
107
  #### Parameters
100
108
 
101
- **err**: `unknown`
109
+ ##### err
110
+
111
+ `unknown`
102
112
 
103
113
  The existing error.
104
114
 
@@ -122,7 +132,9 @@ Flatten an error tree.
122
132
 
123
133
  #### Parameters
124
134
 
125
- **err**: `unknown`
135
+ ##### err
136
+
137
+ `unknown`
126
138
 
127
139
  The starting error.
128
140
 
@@ -146,10 +158,12 @@ Expand an error tree.
146
158
 
147
159
  #### Parameters
148
160
 
149
- **errors**: `undefined` \| [`IError`](../interfaces/IError.md)[]
161
+ ##### errors
150
162
 
151
163
  The list of errors to expand.
152
164
 
165
+ `undefined` | [`IError`](../interfaces/IError.md)[]
166
+
153
167
  #### Returns
154
168
 
155
169
  `undefined` \| [`IError`](../interfaces/IError.md)
@@ -170,14 +184,18 @@ Test to see if the error has the specified error name.
170
184
 
171
185
  #### Parameters
172
186
 
173
- **error**: `unknown`
187
+ ##### error
188
+
189
+ `unknown`
174
190
 
175
191
  The error to test.
176
192
 
177
- **name**: `string` \| `RegExp`
193
+ ##### name
178
194
 
179
195
  The name to check for.
180
196
 
197
+ `string` | `RegExp`
198
+
181
199
  #### Returns
182
200
 
183
201
  `error is BaseError`
@@ -198,14 +216,18 @@ Test to see if the error has the specified error message.
198
216
 
199
217
  #### Parameters
200
218
 
201
- **error**: `unknown`
219
+ ##### error
220
+
221
+ `unknown`
202
222
 
203
223
  The error to test.
204
224
 
205
- **message**: `string` \| `RegExp`
225
+ ##### message
206
226
 
207
227
  The message to check for.
208
228
 
229
+ `string` | `RegExp`
230
+
209
231
  #### Returns
210
232
 
211
233
  `error is BaseError`
@@ -226,14 +248,18 @@ Test to see if the error has the specified error code.
226
248
 
227
249
  #### Parameters
228
250
 
229
- **error**: `unknown`
251
+ ##### error
252
+
253
+ `unknown`
230
254
 
231
255
  The error to test.
232
256
 
233
- **code**: `string` \| `RegExp`
257
+ ##### code
234
258
 
235
259
  The code to check for.
236
260
 
261
+ `string` | `RegExp`
262
+
237
263
  #### Returns
238
264
 
239
265
  `boolean`
@@ -254,14 +280,18 @@ Test to see if any of the errors or children have the given error name.
254
280
 
255
281
  #### Parameters
256
282
 
257
- **error**: `unknown`
283
+ ##### error
284
+
285
+ `unknown`
258
286
 
259
287
  The error to test.
260
288
 
261
- **name**: `string` \| `RegExp`
289
+ ##### name
262
290
 
263
291
  The name to check for.
264
292
 
293
+ `string` | `RegExp`
294
+
265
295
  #### Returns
266
296
 
267
297
  `error is BaseError`
@@ -282,14 +312,18 @@ Test to see if any of the errors or children have the given error message.
282
312
 
283
313
  #### Parameters
284
314
 
285
- **error**: `unknown`
315
+ ##### error
316
+
317
+ `unknown`
286
318
 
287
319
  The error to test.
288
320
 
289
- **message**: `string` \| `RegExp`
321
+ ##### message
290
322
 
291
323
  The message to check for.
292
324
 
325
+ `string` | `RegExp`
326
+
293
327
  #### Returns
294
328
 
295
329
  `error is BaseError`
@@ -310,11 +344,15 @@ Test to see if any of the errors or children are from a specific class.
310
344
 
311
345
  #### Parameters
312
346
 
313
- **error**: `unknown`
347
+ ##### error
348
+
349
+ `unknown`
314
350
 
315
351
  The error to test.
316
352
 
317
- **cls**: `string`
353
+ ##### cls
354
+
355
+ `string`
318
356
 
319
357
  The class to check for.
320
358
 
@@ -338,14 +376,18 @@ Test to see if any of the errors or children have the given error code.
338
376
 
339
377
  #### Parameters
340
378
 
341
- **error**: `unknown`
379
+ ##### error
380
+
381
+ `unknown`
342
382
 
343
383
  The error to test.
344
384
 
345
- **code**: `string` \| `RegExp`
385
+ ##### code
346
386
 
347
387
  The code to check for.
348
388
 
389
+ `string` | `RegExp`
390
+
349
391
  #### Returns
350
392
 
351
393
  `error is BaseError`
@@ -360,10 +402,18 @@ True if the error has the name.
360
402
 
361
403
  ### toJsonObject()
362
404
 
363
- > **toJsonObject**(): [`IError`](../interfaces/IError.md)
405
+ > **toJsonObject**(`includeStackTrace?`): [`IError`](../interfaces/IError.md)
364
406
 
365
407
  Serialize the error to the error model.
366
408
 
409
+ #### Parameters
410
+
411
+ ##### includeStackTrace?
412
+
413
+ `boolean`
414
+
415
+ Whether to include the error stack in the model, defaults to false.
416
+
367
417
  #### Returns
368
418
 
369
419
  [`IError`](../interfaces/IError.md)
@@ -4,13 +4,13 @@ Class to help with arrays.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new ArrayHelper()
7
+ ### Constructor
8
8
 
9
- > **new ArrayHelper**(): [`ArrayHelper`](ArrayHelper.md)
9
+ > **new ArrayHelper**(): `ArrayHelper`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`ArrayHelper`](ArrayHelper.md)
13
+ `ArrayHelper`
14
14
 
15
15
  ## Methods
16
16
 
@@ -22,11 +22,15 @@ Do the two arrays match.
22
22
 
23
23
  #### Parameters
24
24
 
25
- **arr1**: `unknown`
25
+ ##### arr1
26
+
27
+ `unknown`
26
28
 
27
29
  The first array.
28
30
 
29
- **arr2**: `unknown`
31
+ ##### arr2
32
+
33
+ `unknown`
30
34
 
31
35
  The second array.
32
36
 
@@ -35,3 +39,73 @@ The second array.
35
39
  `boolean`
36
40
 
37
41
  True if both arrays are empty of have the same values.
42
+
43
+ ***
44
+
45
+ ### fromObjectOrArray()
46
+
47
+ Convert an object or array to an array.
48
+
49
+ #### Param
50
+
51
+ The object or array to convert.
52
+
53
+ #### Call Signature
54
+
55
+ > `static` **fromObjectOrArray**\<`T`\>(`value`): `undefined`
56
+
57
+ Convert an object or array to an array.
58
+
59
+ ##### Type Parameters
60
+
61
+ ###### T
62
+
63
+ `T` = `unknown`
64
+
65
+ ##### Parameters
66
+
67
+ ###### value
68
+
69
+ `undefined`
70
+
71
+ The object or array to convert.
72
+
73
+ ##### Returns
74
+
75
+ `undefined`
76
+
77
+ The array.
78
+
79
+ ##### Param
80
+
81
+ The object or array to convert.
82
+
83
+ #### Call Signature
84
+
85
+ > `static` **fromObjectOrArray**\<`T`\>(`value`): `T`[]
86
+
87
+ Convert an object or array to an array.
88
+
89
+ ##### Type Parameters
90
+
91
+ ###### T
92
+
93
+ `T` = `unknown`
94
+
95
+ ##### Parameters
96
+
97
+ ###### value
98
+
99
+ [`ObjectOrArray`](../type-aliases/ObjectOrArray.md)\<`T`\>
100
+
101
+ The object or array to convert.
102
+
103
+ ##### Returns
104
+
105
+ `T`[]
106
+
107
+ The array.
108
+
109
+ ##### Param
110
+
111
+ The object or array to convert.