Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@dmail/uneval
Advanced tools
[![npm package](https://img.shields.io/npm/v/@dmail/uneval.svg)](https://www.npmjs.com/package/@dmail/uneval) [![build](https://travis-ci.com/dmail/uneval.svg?branch=master)](http://travis-ci.com/dmail/uneval) [![codecov](https://codecov.io/gh/dmail/uneva
Overcome JSON.stringify limitations.
uneval
uneval
is a function turning a JavaScript value into a string that can be evaluated.
It exists to overcome JSON.stringify
limitations.
But you should better use JSON.stringify
and avoid using uneval
at all.
However, if some JSON.stringify
limitations is a problem for you uneval
might be what you're looking for.
JSON.stringify
limitations{}
JSON.stringify(/foo/) === "{}"
-0
into 0
JSON.stringify(-0) === "0"
NaN
into null
JSON.stringify(NaN) === "null"
Infinity
into null
JSON.stringify(Infinity) === "null"
const value = {}
value.self = value
try {
JSON.stringify(value)
} catch (error) {
error.name === "TypeError"
}
JSON.stringify(new Date(0)) === `"1970-01-01T00:00:00.000Z"`
JSON.stringify(["very-long-string", "very-long-string"]) ===
`["very-long-string","very-long-string"]`
"very-long-string"
is repeated twice. It can becomes a waste if you use it to stringify very big structures.
JSON.stringify(Object.defineProperty({}, "foo", { enumerable: false })) === "{}"
Live browser example: https://dmail.github.io/uneval/#browser-example.
Live node example: https://dmail.github.io/uneval/#node-example
FAQs
[![npm package](https://img.shields.io/npm/v/@dmail/uneval.svg)](https://www.npmjs.com/package/@dmail/uneval) [![build](https://travis-ci.com/dmail/uneval.svg?branch=master)](http://travis-ci.com/dmail/uneval) [![codecov](https://codecov.io/gh/dmail/uneva
The npm package @dmail/uneval receives a total of 6 weekly downloads. As such, @dmail/uneval popularity was classified as not popular.
We found that @dmail/uneval demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.