@naturalcycles/js-lib 15.0.1 → 15.2.0
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/error/error.util.js +3 -0
- package/dist/types.d.ts +6 -0
- package/package.json +6 -4
- package/src/error/error.util.ts +2 -0
- package/src/types.ts +7 -0
package/dist/error/error.util.js
CHANGED
|
@@ -264,6 +264,9 @@ export class AppError extends Error {
|
|
|
264
264
|
enumerable: true, // unlike standard - setting it to true for "visibility"
|
|
265
265
|
});
|
|
266
266
|
}
|
|
267
|
+
else {
|
|
268
|
+
delete this.cause; // otherwise it's printed as `cause: undefined`
|
|
269
|
+
}
|
|
267
270
|
// this is to allow changing this.constuctor.name to a non-minified version
|
|
268
271
|
Object.defineProperty(this.constructor, 'name', {
|
|
269
272
|
value: name,
|
package/dist/types.d.ts
CHANGED
|
@@ -233,6 +233,12 @@ export type PositiveInteger = number;
|
|
|
233
233
|
export type NonNegativeInteger = number;
|
|
234
234
|
export type PositiveNumber = number;
|
|
235
235
|
export type NonNegativeNumber = number;
|
|
236
|
+
/**
|
|
237
|
+
* Same as `number`, but with semantic meaning that it's a Float.
|
|
238
|
+
*/
|
|
239
|
+
export type Float = number;
|
|
240
|
+
export type PositiveFloat = number;
|
|
241
|
+
export type NonNegativeFloat = number;
|
|
236
242
|
/**
|
|
237
243
|
* Convenience type alias, that allows to write this:
|
|
238
244
|
*
|
package/package.json
CHANGED
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturalcycles/js-lib",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "15.0
|
|
4
|
+
"version": "15.2.0",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"tslib": "^2",
|
|
7
7
|
"zod": "^3"
|
|
8
8
|
},
|
|
9
9
|
"devDependencies": {
|
|
10
|
-
"@naturalcycles/
|
|
10
|
+
"@naturalcycles/dev-lib": "*",
|
|
11
11
|
"@types/crypto-js": "^4",
|
|
12
12
|
"@types/node": "^22",
|
|
13
13
|
"@types/semver": "^7",
|
|
14
|
-
"crypto-js": "^4"
|
|
14
|
+
"crypto-js": "^4",
|
|
15
|
+
"dayjs": "^1"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
18
|
"dist",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
},
|
|
34
35
|
"repository": {
|
|
35
36
|
"type": "git",
|
|
36
|
-
"url": "git@github.com:NaturalCycles/js-
|
|
37
|
+
"url": "git@github.com:NaturalCycles/js-libs.git",
|
|
37
38
|
"directory": "packages/js-lib"
|
|
38
39
|
},
|
|
39
40
|
"description": "Standard library for universal (browser + Node.js) javascript",
|
|
@@ -51,6 +52,7 @@
|
|
|
51
52
|
"lint": "dev-lib lint",
|
|
52
53
|
"bt": "dev-lib bt",
|
|
53
54
|
"lbt": "dev-lib lbt",
|
|
55
|
+
"check": "dev-lib lbt",
|
|
54
56
|
"test-tz1": "TZ=Europe/Stockholm yarn test local",
|
|
55
57
|
"test-tz2": "TZ=JST-9 yarn test local",
|
|
56
58
|
"test-ny": "TZ=GMT-0500 yarn test localTime"
|
package/src/error/error.util.ts
CHANGED
|
@@ -351,6 +351,8 @@ export class AppError<DATA_TYPE extends ErrorData = ErrorData> extends Error {
|
|
|
351
351
|
configurable: true,
|
|
352
352
|
enumerable: true, // unlike standard - setting it to true for "visibility"
|
|
353
353
|
})
|
|
354
|
+
} else {
|
|
355
|
+
delete this.cause // otherwise it's printed as `cause: undefined`
|
|
354
356
|
}
|
|
355
357
|
|
|
356
358
|
// this is to allow changing this.constuctor.name to a non-minified version
|
package/src/types.ts
CHANGED
|
@@ -297,6 +297,13 @@ export type NonNegativeInteger = number
|
|
|
297
297
|
export type PositiveNumber = number
|
|
298
298
|
export type NonNegativeNumber = number
|
|
299
299
|
|
|
300
|
+
/**
|
|
301
|
+
* Same as `number`, but with semantic meaning that it's a Float.
|
|
302
|
+
*/
|
|
303
|
+
export type Float = number
|
|
304
|
+
export type PositiveFloat = number
|
|
305
|
+
export type NonNegativeFloat = number
|
|
306
|
+
|
|
300
307
|
/**
|
|
301
308
|
* Convenience type alias, that allows to write this:
|
|
302
309
|
*
|