@oliversalzburg/js-utils 0.0.7 → 0.0.9

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 (172) hide show
  1. package/LICENSES.md +17 -0
  2. package/_site/assets/highlight.css +57 -0
  3. package/_site/assets/main.js +59 -0
  4. package/_site/assets/navigation.js +1 -0
  5. package/_site/assets/search.js +1 -0
  6. package/_site/assets/style.css +1383 -0
  7. package/_site/classes/AbstractError.html +28 -0
  8. package/_site/classes/Canvas.html +44 -0
  9. package/_site/classes/InternalError.html +32 -0
  10. package/_site/classes/InvalidArgumentError.html +28 -0
  11. package/_site/classes/InvalidOperationError.html +28 -0
  12. package/_site/classes/NotImplementedError.html +27 -0
  13. package/_site/classes/PermissionViolationError.html +28 -0
  14. package/_site/classes/Random.html +43 -0
  15. package/_site/classes/RenderLoop.html +30 -0
  16. package/_site/classes/ResourceConflictError.html +27 -0
  17. package/_site/classes/UnexpectedNilError.html +15 -0
  18. package/_site/classes/UnknownError.html +31 -0
  19. package/_site/classes/Vector2.html +113 -0
  20. package/_site/classes/Vector3.html +28 -0
  21. package/_site/functions/addVector2.html +5 -0
  22. package/_site/functions/blend.html +8 -0
  23. package/_site/functions/blendAdditive.html +8 -0
  24. package/_site/functions/blendSubtractive.html +8 -0
  25. package/_site/functions/cosDeg.html +4 -0
  26. package/_site/functions/deg2rad.html +4 -0
  27. package/_site/functions/difference.html +7 -0
  28. package/_site/functions/distance.html +7 -0
  29. package/_site/functions/errorToJSON.html +4 -0
  30. package/_site/functions/errorToRecord.html +4 -0
  31. package/_site/functions/errorToSimpleSerializable.html +4 -0
  32. package/_site/functions/filterType.html +7 -0
  33. package/_site/functions/formatString.html +7 -0
  34. package/_site/functions/formatStringTemplate.html +7 -0
  35. package/_site/functions/fromRGB.html +7 -0
  36. package/_site/functions/fromRGBA.html +7 -0
  37. package/_site/functions/getA.html +4 -0
  38. package/_site/functions/getB.html +4 -0
  39. package/_site/functions/getDocumentElementTypeById.html +9 -0
  40. package/_site/functions/getG.html +4 -0
  41. package/_site/functions/getR.html +4 -0
  42. package/_site/functions/intersect.html +8 -0
  43. package/_site/functions/is.html +7 -0
  44. package/_site/functions/isError.html +4 -0
  45. package/_site/functions/isInteger.html +4 -0
  46. package/_site/functions/isNil.html +5 -0
  47. package/_site/functions/isqrt.html +4 -0
  48. package/_site/functions/multiplyVector2.html +5 -0
  49. package/_site/functions/mustExist.html +6 -0
  50. package/_site/functions/nextPalette.html +2 -0
  51. package/_site/functions/putPixel32.html +7 -0
  52. package/_site/functions/putPixel32Add.html +7 -0
  53. package/_site/functions/putPixel32Sub.html +7 -0
  54. package/_site/functions/putSubPixel32.html +8 -0
  55. package/_site/functions/rad2deg.html +4 -0
  56. package/_site/functions/randomRange.html +6 -0
  57. package/_site/functions/safeRGBComponent.html +4 -0
  58. package/_site/functions/seedFromString.html +5 -0
  59. package/_site/functions/shuffleArray.html +5 -0
  60. package/_site/functions/sinDeg.html +4 -0
  61. package/_site/functions/sleep.html +4 -0
  62. package/_site/functions/somecolor.html +4 -0
  63. package/_site/functions/subtractVector2.html +5 -0
  64. package/_site/functions/toGrayScale.html +4 -0
  65. package/_site/functions/unknownToError.html +6 -0
  66. package/_site/index.html +1 -0
  67. package/_site/modules.html +72 -0
  68. package/_site/types/AnyConstructor.html +2 -0
  69. package/_site/types/AnyFunction.html +2 -0
  70. package/_site/types/ConstructorOf.html +2 -0
  71. package/_site/types/FunctionReturning.html +2 -0
  72. package/_site/types/Maybe.html +2 -0
  73. package/_site/types/Mixin.html +3 -0
  74. package/_site/types/Nil.html +3 -0
  75. package/_site/types/RenderLoopCallback.html +2 -0
  76. package/_site/types/SerializedError.html +2 -0
  77. package/_site/variables/PALETTES.html +2 -0
  78. package/_site/variables/TWO_PI.html +2 -0
  79. package/_site/variables/random-1.html +2 -0
  80. package/lib/array.d.ts +8 -0
  81. package/lib/array.js +8 -0
  82. package/lib/array.js.map +1 -1
  83. package/lib/dom/core.d.ts +13 -0
  84. package/lib/dom/core.js +24 -0
  85. package/lib/dom/core.js.map +1 -0
  86. package/lib/dom/index.d.ts +1 -0
  87. package/lib/dom/index.js +2 -0
  88. package/lib/dom/index.js.map +1 -0
  89. package/lib/error-serializer.d.ts +12 -6
  90. package/lib/error-serializer.js +11 -7
  91. package/lib/error-serializer.js.map +1 -1
  92. package/lib/error-serializer.test.d.ts +1 -0
  93. package/lib/error-serializer.test.js +117 -0
  94. package/lib/error-serializer.test.js.map +1 -0
  95. package/lib/errors/AbstractError.d.ts +4 -16
  96. package/lib/errors/AbstractError.js +4 -16
  97. package/lib/errors/AbstractError.js.map +1 -1
  98. package/lib/errors/InternalError.d.ts +6 -5
  99. package/lib/errors/InternalError.js +6 -7
  100. package/lib/errors/InternalError.js.map +1 -1
  101. package/lib/errors/InvalidArgumentError.d.ts +2 -1
  102. package/lib/errors/InvalidArgumentError.js +2 -1
  103. package/lib/errors/InvalidArgumentError.js.map +1 -1
  104. package/lib/errors/InvalidOperationError.d.ts +2 -1
  105. package/lib/errors/InvalidOperationError.js +2 -1
  106. package/lib/errors/InvalidOperationError.js.map +1 -1
  107. package/lib/errors/NotImplementedError.d.ts +2 -1
  108. package/lib/errors/NotImplementedError.js +2 -1
  109. package/lib/errors/NotImplementedError.js.map +1 -1
  110. package/lib/errors/PermissionViolationError.d.ts +2 -1
  111. package/lib/errors/PermissionViolationError.js +2 -1
  112. package/lib/errors/PermissionViolationError.js.map +1 -1
  113. package/lib/errors/ResourceConflictError.d.ts +2 -1
  114. package/lib/errors/ResourceConflictError.js +2 -1
  115. package/lib/errors/ResourceConflictError.js.map +1 -1
  116. package/lib/errors/UnknownError.d.ts +6 -5
  117. package/lib/errors/UnknownError.js +6 -5
  118. package/lib/errors/UnknownError.js.map +1 -1
  119. package/lib/graphics/canvas.d.ts +55 -19
  120. package/lib/graphics/canvas.js +66 -18
  121. package/lib/graphics/canvas.js.map +1 -1
  122. package/lib/graphics/core.d.ts +18 -0
  123. package/lib/graphics/core.js +18 -0
  124. package/lib/graphics/core.js.map +1 -1
  125. package/lib/graphics/render-loop.d.ts +25 -4
  126. package/lib/graphics/render-loop.js +19 -2
  127. package/lib/graphics/render-loop.js.map +1 -1
  128. package/lib/index.d.ts +1 -0
  129. package/lib/index.js +1 -0
  130. package/lib/index.js.map +1 -1
  131. package/lib/math/core.d.ts +12 -1
  132. package/lib/math/core.js +13 -2
  133. package/lib/math/core.js.map +1 -1
  134. package/lib/math/index.d.ts +2 -0
  135. package/lib/math/index.js +2 -0
  136. package/lib/math/index.js.map +1 -1
  137. package/lib/math/vector.d.ts +2 -33
  138. package/lib/math/vector.js +2 -41
  139. package/lib/math/vector.js.map +1 -1
  140. package/lib/math/vector2.d.ts +195 -0
  141. package/lib/math/vector2.js +299 -0
  142. package/lib/math/vector2.js.map +1 -0
  143. package/lib/math/vector3.d.ts +46 -0
  144. package/lib/math/vector3.js +59 -0
  145. package/lib/math/vector3.js.map +1 -0
  146. package/lib/nil.d.ts +1 -0
  147. package/lib/nil.js +1 -0
  148. package/lib/nil.js.map +1 -1
  149. package/lib/random.d.ts +40 -4
  150. package/lib/random.js +175 -14
  151. package/lib/random.js.map +1 -1
  152. package/lib/string-formatter.d.ts +2 -0
  153. package/lib/string-formatter.js +2 -0
  154. package/lib/string-formatter.js.map +1 -1
  155. package/package.json +10 -10
  156. package/docs/README.md +0 -3
  157. package/docs/classes/AbstractError.md +0 -271
  158. package/docs/classes/Canvas.md +0 -177
  159. package/docs/classes/InternalError.md +0 -301
  160. package/docs/classes/InvalidArgumentError.md +0 -277
  161. package/docs/classes/InvalidOperationError.md +0 -277
  162. package/docs/classes/NotImplementedError.md +0 -276
  163. package/docs/classes/PermissionViolationError.md +0 -277
  164. package/docs/classes/Random.md +0 -109
  165. package/docs/classes/RenderLoop.md +0 -49
  166. package/docs/classes/ResourceConflictError.md +0 -276
  167. package/docs/classes/UnexpectedNilError.md +0 -169
  168. package/docs/classes/UnknownError.md +0 -280
  169. package/docs/classes/Vector2.md +0 -79
  170. package/docs/classes/Vector3.md +0 -106
  171. package/docs/modules.md +0 -1313
  172. package/typedoc.json +0 -8
@@ -1,301 +0,0 @@
1
- [@oliversalzburg/js-utils](../README.md) / [Exports](../modules.md) / InternalError
2
-
3
- # Class: InternalError
4
-
5
- Used when an `Error`-like object was caught and converted into an
6
- implementation of `AbstractError` for further processing.
7
-
8
- ## Hierarchy
9
-
10
- - [`AbstractError`](AbstractError.md)
11
-
12
- ↳ **`InternalError`**
13
-
14
- ## Constructors
15
-
16
- ### constructor
17
-
18
- • **new InternalError**(`message`, `status?`): [`InternalError`](InternalError.md)
19
-
20
- Constructs a new [InternalError](InternalError.md).
21
-
22
- #### Parameters
23
-
24
- | Name | Type | Default value | Description |
25
- | :-------- | :------- | :------------ | :------------------------------ |
26
- | `message` | `string` | `undefined` | The main error message. |
27
- | `status` | `number` | `500` | The HTTP status code to return. |
28
-
29
- #### Returns
30
-
31
- [`InternalError`](InternalError.md)
32
-
33
- #### Overrides
34
-
35
- [AbstractError](AbstractError.md).[constructor](AbstractError.md#constructor)
36
-
37
- #### Defined in
38
-
39
- [errors/InternalError.ts:13](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/InternalError.ts#L13)
40
-
41
- ## Properties
42
-
43
- ### cause
44
-
45
- • `Optional` **cause**: `unknown`
46
-
47
- #### Inherited from
48
-
49
- [AbstractError](AbstractError.md).[cause](AbstractError.md#cause)
50
-
51
- #### Defined in
52
-
53
- ../node_modules/typescript/lib/lib.es2022.error.d.ts:24
54
-
55
- ---
56
-
57
- ### code
58
-
59
- • **code**: `string`
60
-
61
- An application-unique, readable error code.
62
-
63
- #### Inherited from
64
-
65
- [AbstractError](AbstractError.md).[code](AbstractError.md#code)
66
-
67
- #### Defined in
68
-
69
- [errors/AbstractError.ts:29](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L29)
70
-
71
- ---
72
-
73
- ### info
74
-
75
- • **info**: [`Maybe`](../modules.md#maybe)\<`string`\>
76
-
77
- A user-friendly error message that may be transported to the client.
78
-
79
- **`Deprecated`**
80
-
81
- User-friendly errors should be read from `extensions`.
82
-
83
- #### Inherited from
84
-
85
- [AbstractError](AbstractError.md).[info](AbstractError.md#info)
86
-
87
- #### Defined in
88
-
89
- [errors/AbstractError.ts:24](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L24)
90
-
91
- ---
92
-
93
- ### inner
94
-
95
- • **inner**: [`Maybe`](../modules.md#maybe)\<`Error`\>
96
-
97
- Another error that should be transported with this error.
98
-
99
- **`Deprecated`**
100
-
101
- We don't make use of this or interpret nested errors at all.
102
-
103
- #### Inherited from
104
-
105
- [AbstractError](AbstractError.md).[inner](AbstractError.md#inner)
106
-
107
- #### Defined in
108
-
109
- [errors/AbstractError.ts:18](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L18)
110
-
111
- ---
112
-
113
- ### message
114
-
115
- • **message**: `string`
116
-
117
- #### Inherited from
118
-
119
- [AbstractError](AbstractError.md).[message](AbstractError.md#message)
120
-
121
- #### Defined in
122
-
123
- ../node_modules/typescript/lib/lib.es5.d.ts:1068
124
-
125
- ---
126
-
127
- ### name
128
-
129
- • **name**: `string`
130
-
131
- #### Inherited from
132
-
133
- [AbstractError](AbstractError.md).[name](AbstractError.md#name)
134
-
135
- #### Defined in
136
-
137
- ../node_modules/typescript/lib/lib.es5.d.ts:1067
138
-
139
- ---
140
-
141
- ### stack
142
-
143
- • `Optional` **stack**: `string`
144
-
145
- #### Inherited from
146
-
147
- [AbstractError](AbstractError.md).[stack](AbstractError.md#stack)
148
-
149
- #### Defined in
150
-
151
- ../node_modules/typescript/lib/lib.es5.d.ts:1069
152
-
153
- ---
154
-
155
- ### status
156
-
157
- • **status**: `number`
158
-
159
- The HTTP status code to associate with this error.
160
-
161
- **`Deprecated`**
162
-
163
- We no longer respond to HTTP requests with error-specifc
164
- status codes.
165
-
166
- #### Inherited from
167
-
168
- [AbstractError](AbstractError.md).[status](AbstractError.md#status)
169
-
170
- #### Defined in
171
-
172
- [errors/AbstractError.ts:12](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L12)
173
-
174
- ---
175
-
176
- ### prepareStackTrace
177
-
178
- ▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
179
-
180
- #### Type declaration
181
-
182
- ▸ (`err`, `stackTraces`): `any`
183
-
184
- Optional override for formatting stack traces
185
-
186
- ##### Parameters
187
-
188
- | Name | Type |
189
- | :------------ | :----------- |
190
- | `err` | `Error` |
191
- | `stackTraces` | `CallSite`[] |
192
-
193
- ##### Returns
194
-
195
- `any`
196
-
197
- **`See`**
198
-
199
- https://v8.dev/docs/stack-trace-api#customizing-stack-traces
200
-
201
- #### Inherited from
202
-
203
- [AbstractError](AbstractError.md).[prepareStackTrace](AbstractError.md#preparestacktrace)
204
-
205
- #### Defined in
206
-
207
- ../node_modules/@types/node/globals.d.ts:11
208
-
209
- ---
210
-
211
- ### stackTraceLimit
212
-
213
- ▪ `Static` **stackTraceLimit**: `number`
214
-
215
- #### Inherited from
216
-
217
- [AbstractError](AbstractError.md).[stackTraceLimit](AbstractError.md#stacktracelimit)
218
-
219
- #### Defined in
220
-
221
- ../node_modules/@types/node/globals.d.ts:13
222
-
223
- ## Methods
224
-
225
- ### captureStackTrace
226
-
227
- ▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
228
-
229
- Create .stack property on a target object
230
-
231
- #### Parameters
232
-
233
- | Name | Type |
234
- | :---------------- | :--------- |
235
- | `targetObject` | `object` |
236
- | `constructorOpt?` | `Function` |
237
-
238
- #### Returns
239
-
240
- `void`
241
-
242
- #### Inherited from
243
-
244
- [AbstractError](AbstractError.md).[captureStackTrace](AbstractError.md#capturestacktrace)
245
-
246
- #### Defined in
247
-
248
- ../node_modules/@types/node/globals.d.ts:4
249
-
250
- ---
251
-
252
- ### fromError
253
-
254
- ▸ **fromError**(`error`): [`InternalError`](InternalError.md)
255
-
256
- Converts an error into an [InternalError](InternalError.md).
257
-
258
- #### Parameters
259
-
260
- | Name | Type | Description |
261
- | :------ | :------ | :-------------------- |
262
- | `error` | `Error` | The error to convert. |
263
-
264
- #### Returns
265
-
266
- [`InternalError`](InternalError.md)
267
-
268
- An [InternalError](InternalError.md) that represents the given error.
269
-
270
- #### Defined in
271
-
272
- [errors/InternalError.ts:28](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/InternalError.ts#L28)
273
-
274
- ---
275
-
276
- ### isAbstractError
277
-
278
- ▸ **isAbstractError**(`error`, `allowForeignModule?`): error is AbstractError
279
-
280
- Checks if an object is an instance of [AbstractError](AbstractError.md), or one of its subclasses.
281
-
282
- #### Parameters
283
-
284
- | Name | Type | Default value | Description |
285
- | :------------------- | :-------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
286
- | `error` | `unknown` | `undefined` | The object to check. |
287
- | `allowForeignModule` | `boolean` | `true` | Only check for similar looking error codes. You're going to want to use this if you're dealing with a setup where multiple versions of js-utils are loaded. |
288
-
289
- #### Returns
290
-
291
- error is AbstractError
292
-
293
- `true` if the object is an [AbstractError](AbstractError.md), `false` otherwise.
294
-
295
- #### Inherited from
296
-
297
- [AbstractError](AbstractError.md).[isAbstractError](AbstractError.md#isabstracterror)
298
-
299
- #### Defined in
300
-
301
- [errors/AbstractError.ts:58](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L58)
@@ -1,277 +0,0 @@
1
- [@oliversalzburg/js-utils](../README.md) / [Exports](../modules.md) / InvalidArgumentError
2
-
3
- # Class: InvalidArgumentError
4
-
5
- Used when the user supplied an argument that is not valid in the current
6
- context.
7
-
8
- ## Hierarchy
9
-
10
- - [`AbstractError`](AbstractError.md)
11
-
12
- ↳ **`InvalidArgumentError`**
13
-
14
- ## Constructors
15
-
16
- ### constructor
17
-
18
- • **new InvalidArgumentError**(`message`, `status?`): [`InvalidArgumentError`](InvalidArgumentError.md)
19
-
20
- Constructs a new [InvalidArgumentError](InvalidArgumentError.md).
21
-
22
- #### Parameters
23
-
24
- | Name | Type | Default value | Description |
25
- | :-------- | :------- | :------------ | :------------------------------ |
26
- | `message` | `string` | `undefined` | The main error message. |
27
- | `status` | `number` | `400` | The HTTP status code to return. |
28
-
29
- #### Returns
30
-
31
- [`InvalidArgumentError`](InvalidArgumentError.md)
32
-
33
- #### Overrides
34
-
35
- [AbstractError](AbstractError.md).[constructor](AbstractError.md#constructor)
36
-
37
- #### Defined in
38
-
39
- [errors/InvalidArgumentError.ts:13](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/InvalidArgumentError.ts#L13)
40
-
41
- ## Properties
42
-
43
- ### cause
44
-
45
- • `Optional` **cause**: `unknown`
46
-
47
- #### Inherited from
48
-
49
- [AbstractError](AbstractError.md).[cause](AbstractError.md#cause)
50
-
51
- #### Defined in
52
-
53
- ../node_modules/typescript/lib/lib.es2022.error.d.ts:24
54
-
55
- ---
56
-
57
- ### code
58
-
59
- • **code**: `string`
60
-
61
- An application-unique, readable error code.
62
-
63
- #### Inherited from
64
-
65
- [AbstractError](AbstractError.md).[code](AbstractError.md#code)
66
-
67
- #### Defined in
68
-
69
- [errors/AbstractError.ts:29](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L29)
70
-
71
- ---
72
-
73
- ### info
74
-
75
- • **info**: [`Maybe`](../modules.md#maybe)\<`string`\>
76
-
77
- A user-friendly error message that may be transported to the client.
78
-
79
- **`Deprecated`**
80
-
81
- User-friendly errors should be read from `extensions`.
82
-
83
- #### Inherited from
84
-
85
- [AbstractError](AbstractError.md).[info](AbstractError.md#info)
86
-
87
- #### Defined in
88
-
89
- [errors/AbstractError.ts:24](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L24)
90
-
91
- ---
92
-
93
- ### inner
94
-
95
- • **inner**: [`Maybe`](../modules.md#maybe)\<`Error`\>
96
-
97
- Another error that should be transported with this error.
98
-
99
- **`Deprecated`**
100
-
101
- We don't make use of this or interpret nested errors at all.
102
-
103
- #### Inherited from
104
-
105
- [AbstractError](AbstractError.md).[inner](AbstractError.md#inner)
106
-
107
- #### Defined in
108
-
109
- [errors/AbstractError.ts:18](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L18)
110
-
111
- ---
112
-
113
- ### message
114
-
115
- • **message**: `string`
116
-
117
- #### Inherited from
118
-
119
- [AbstractError](AbstractError.md).[message](AbstractError.md#message)
120
-
121
- #### Defined in
122
-
123
- ../node_modules/typescript/lib/lib.es5.d.ts:1068
124
-
125
- ---
126
-
127
- ### name
128
-
129
- • **name**: `string`
130
-
131
- #### Inherited from
132
-
133
- [AbstractError](AbstractError.md).[name](AbstractError.md#name)
134
-
135
- #### Defined in
136
-
137
- ../node_modules/typescript/lib/lib.es5.d.ts:1067
138
-
139
- ---
140
-
141
- ### stack
142
-
143
- • `Optional` **stack**: `string`
144
-
145
- #### Inherited from
146
-
147
- [AbstractError](AbstractError.md).[stack](AbstractError.md#stack)
148
-
149
- #### Defined in
150
-
151
- ../node_modules/typescript/lib/lib.es5.d.ts:1069
152
-
153
- ---
154
-
155
- ### status
156
-
157
- • **status**: `number`
158
-
159
- The HTTP status code to associate with this error.
160
-
161
- **`Deprecated`**
162
-
163
- We no longer respond to HTTP requests with error-specifc
164
- status codes.
165
-
166
- #### Inherited from
167
-
168
- [AbstractError](AbstractError.md).[status](AbstractError.md#status)
169
-
170
- #### Defined in
171
-
172
- [errors/AbstractError.ts:12](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L12)
173
-
174
- ---
175
-
176
- ### prepareStackTrace
177
-
178
- ▪ `Static` `Optional` **prepareStackTrace**: (`err`: `Error`, `stackTraces`: `CallSite`[]) => `any`
179
-
180
- #### Type declaration
181
-
182
- ▸ (`err`, `stackTraces`): `any`
183
-
184
- Optional override for formatting stack traces
185
-
186
- ##### Parameters
187
-
188
- | Name | Type |
189
- | :------------ | :----------- |
190
- | `err` | `Error` |
191
- | `stackTraces` | `CallSite`[] |
192
-
193
- ##### Returns
194
-
195
- `any`
196
-
197
- **`See`**
198
-
199
- https://v8.dev/docs/stack-trace-api#customizing-stack-traces
200
-
201
- #### Inherited from
202
-
203
- [AbstractError](AbstractError.md).[prepareStackTrace](AbstractError.md#preparestacktrace)
204
-
205
- #### Defined in
206
-
207
- ../node_modules/@types/node/globals.d.ts:11
208
-
209
- ---
210
-
211
- ### stackTraceLimit
212
-
213
- ▪ `Static` **stackTraceLimit**: `number`
214
-
215
- #### Inherited from
216
-
217
- [AbstractError](AbstractError.md).[stackTraceLimit](AbstractError.md#stacktracelimit)
218
-
219
- #### Defined in
220
-
221
- ../node_modules/@types/node/globals.d.ts:13
222
-
223
- ## Methods
224
-
225
- ### captureStackTrace
226
-
227
- ▸ **captureStackTrace**(`targetObject`, `constructorOpt?`): `void`
228
-
229
- Create .stack property on a target object
230
-
231
- #### Parameters
232
-
233
- | Name | Type |
234
- | :---------------- | :--------- |
235
- | `targetObject` | `object` |
236
- | `constructorOpt?` | `Function` |
237
-
238
- #### Returns
239
-
240
- `void`
241
-
242
- #### Inherited from
243
-
244
- [AbstractError](AbstractError.md).[captureStackTrace](AbstractError.md#capturestacktrace)
245
-
246
- #### Defined in
247
-
248
- ../node_modules/@types/node/globals.d.ts:4
249
-
250
- ---
251
-
252
- ### isAbstractError
253
-
254
- ▸ **isAbstractError**(`error`, `allowForeignModule?`): error is AbstractError
255
-
256
- Checks if an object is an instance of [AbstractError](AbstractError.md), or one of its subclasses.
257
-
258
- #### Parameters
259
-
260
- | Name | Type | Default value | Description |
261
- | :------------------- | :-------- | :------------ | :---------------------------------------------------------------------------------------------------------------------------------------------------------- |
262
- | `error` | `unknown` | `undefined` | The object to check. |
263
- | `allowForeignModule` | `boolean` | `true` | Only check for similar looking error codes. You're going to want to use this if you're dealing with a setup where multiple versions of js-utils are loaded. |
264
-
265
- #### Returns
266
-
267
- error is AbstractError
268
-
269
- `true` if the object is an [AbstractError](AbstractError.md), `false` otherwise.
270
-
271
- #### Inherited from
272
-
273
- [AbstractError](AbstractError.md).[isAbstractError](AbstractError.md#isabstracterror)
274
-
275
- #### Defined in
276
-
277
- [errors/AbstractError.ts:58](https://github.com/oliversalzburg/js-utils/blob/293b24f/source/errors/AbstractError.ts#L58)