javascript-stringify icon indicating copy to clipboard operation
javascript-stringify copied to clipboard

Stringify is to `eval` as `JSON.stringify` is to `JSON.parse`

Results 9 javascript-stringify issues
Sort by recently updated
recently updated
newest added

Just wanted to A) see if there is an existing way to do this without being too hacky (see hacky solution below) and if not, B) suggest the feature or...

currently when using maxDepth/ maxValue, there is no way to know if a item is an empty object/undefined or if its been truncated by this param, I propose adding either...

Currently, all error types seem to be represented as `new Error()`. Other error types like `SyntaxError`, `ReferenceError` etc, are not serialized any differently Suggestion: ```js stringify(new SyntaxError('syntax')); // "new SyntaxError(syntax')"...

Does this lib support stringifying non-enumerable properties in objects?

Briefly, this happens: ```js const obj = {} const map = new Map([['a', obj], ['b', obj]]) const ok = stringify(map) // "new Map([['a',{}],['b',{}]])" const bad = stringify(map, null, null, {...

bug

Hi there, this is a cool library but does not have built-in support for Deno. I've [forked the repo](https://github.com/shah/javascript-stringify) and made minor changes to get it to work on Deno....

enhancement

Hi Blake, I have a feature idea: serializing cross-file. Even with the `references` option enabled, requires/imports evaluate to their references (not the fully-serialized data). Worse comes to worse, one could...

Currently, objects with [getters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/get) and [setters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/set) are not handled correctly: ```ts const input = { _foo: null, get foo() { return this._foo; }, set foo(value) { this._foo = value; }...

enhancement

Currently it's just stringifying the function - I should really be using `Function.prototype.toString` and restoring the function properties though (since a function is just another object). Edit: Also for `RegExp`.

enhancement