Comparing version 7.1.0 to 7.2.0--canary.101.39fab2d.0
@@ -8,2 +8,3 @@ interface Options { | ||
allowClass: boolean; | ||
allowError: boolean; | ||
maxDepth: number; | ||
@@ -10,0 +11,0 @@ space: number | undefined; |
@@ -1399,2 +1399,15 @@ "use strict"; | ||
} | ||
if (value2 instanceof Error && options2.allowError) { | ||
return { | ||
__isConvertedError__: true, | ||
errorProperties: { | ||
...value2.cause ? { cause: value2.cause } : {}, | ||
...value2, | ||
name: value2.name, | ||
message: value2.message, | ||
stack: value2.stack, | ||
"_constructor-name_": value2.constructor.name | ||
} | ||
}; | ||
} | ||
if (value2.constructor && value2.constructor.name && value2.constructor.name !== "Object" && !Array.isArray(value2) && !options2.allowClass) { | ||
@@ -1444,2 +1457,8 @@ return void 0; | ||
} | ||
if (isObject3(value) && value.__isConvertedError__) { | ||
const { message, ...properties } = value.errorProperties; | ||
const error = new Error(message); | ||
Object.assign(error, properties); | ||
return error; | ||
} | ||
if (isObject3(value) && value["_constructor-name_"] && options.allowFunction) { | ||
@@ -1511,2 +1530,3 @@ const name2 = value["_constructor-name_"]; | ||
allowClass: true, | ||
allowError: true, | ||
allowUndefined: true, | ||
@@ -1513,0 +1533,0 @@ allowSymbol: true, |
{ | ||
"name": "telejson", | ||
"version": "7.1.0", | ||
"version": "7.2.0--canary.101.39fab2d.0", | ||
"description": "", | ||
@@ -39,3 +39,4 @@ "keywords": [ | ||
"test-browser": "TZ=UTC jest --env=jsdom ./common ./browser", | ||
"test-node": "TZ=UTC jest --env=node ./common ./node" | ||
"test-node": "TZ=UTC jest --env=node ./common ./node", | ||
"release": "yarn build && auto shipit" | ||
}, | ||
@@ -58,2 +59,3 @@ "eslintConfig": { | ||
"devDependencies": { | ||
"@auto-it/released": "^11.0.1", | ||
"@babel/preset-env": "^7.20.0", | ||
@@ -65,2 +67,3 @@ "@babel/preset-typescript": "^7.18.6", | ||
"@types/lodash-es": "^4.17.6", | ||
"auto": "^11.0.1", | ||
"babel-core": "7.0.0-bridge.0", | ||
@@ -83,3 +86,9 @@ "babel-jest": "^26.6.3", | ||
"access": "public" | ||
}, | ||
"auto": { | ||
"plugins": [ | ||
"npm", | ||
"released" | ||
] | ||
} | ||
} |
@@ -19,2 +19,3 @@ # TeleJSON | ||
- Symbol | ||
- Error | ||
- etc. | ||
@@ -120,2 +121,4 @@ | ||
`allowError`: When set to false, error instances will not be serialized. (default = true) | ||
`allowDate`: When set to false, Date objects will not be serialized. (default = true) | ||
@@ -145,4 +148,12 @@ | ||
first, build the package: | ||
```sh | ||
yarn build | ||
``` | ||
then run the tests: | ||
```sh | ||
yarn test | ||
``` |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119012
3134
157
22
1
13