Comparing version 4.3.2 to 4.3.3
{ | ||
"name": "devalue", | ||
"description": "Gets the job done when JSON.stringify can't", | ||
"version": "4.3.2", | ||
"version": "4.3.3", | ||
"repository": "Rich-Harris/devalue", | ||
@@ -28,3 +28,3 @@ "exports": { | ||
"test": "uvu test", | ||
"prepublishOnly": "npm test && publint && npm run build" | ||
"prepublishOnly": "npm test && npm run build && publint" | ||
}, | ||
@@ -34,2 +34,2 @@ "license": "MIT", | ||
"packageManager": "pnpm@8.5.1" | ||
} | ||
} |
@@ -84,3 +84,3 @@ # devalue | ||
You can serialize and serialize custom types by passing a second argument to `stringify` containing an object of types and their _reducers_, and a second argument to `parse` or `unflatten` containing an object of types and their _revivers_: | ||
You can serialize and deserialize custom types by passing a second argument to `stringify` containing an object of types and their _reducers_, and a second argument to `parse` or `unflatten` containing an object of types and their _revivers_: | ||
@@ -87,0 +87,0 @@ ```js |
@@ -84,3 +84,4 @@ import { | ||
case 'Date': | ||
str = `["Date","${thing.toISOString()}"]`; | ||
const valid = !isNaN(thing.getDate()); | ||
str = `["Date","${valid ? thing.toISOString() : ''}"]`; | ||
break; | ||
@@ -132,2 +133,3 @@ | ||
str += `,${flatten(key)},${flatten(value)}`; | ||
keys.pop(); | ||
} | ||
@@ -134,0 +136,0 @@ |
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
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
25628
651