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

Serialize JavaScript to a superset of JSON that includes regular expressions and functions.

Results 46 serialize-javascript issues
Sort by recently updated
recently updated
newest added

I want to ignore all keys starting with `_` when serializing. Will it be implemented?

allow users to use json-stable-stringify https://github.com/substack/json-stable-stringify

The `randombytes` library may throw an error if the browser does not support the [crypto](https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto). Probably, the good solution in this case would be using the old way of building...

I always get the weirdest issues. So, serialize-javascript works fine in actual production, but it somehow outputs a different thing while running a test. In the example of the object...

![Screenshot from 2020-09-24 09-47-45](https://user-images.githubusercontent.com/58559626/94100531-88d6c400-fe4b-11ea-9f1f-e3c9e086da65.png)

I'm not sure if you want to have symbols as part of this or not ``` js { [Symbol('foo')]: Symbol('bar') } ```

From json.org: > The eval function is very fast. However, it can compile and execute any JavaScript program, so there can be security issues. The use of eval is indicated...

![image](https://user-images.githubusercontent.com/34299724/75939264-a4d14300-5ec4-11ea-8e14-74a7b61a3fa6.png) ![image](https://user-images.githubusercontent.com/34299724/75939282-b286c880-5ec4-11ea-989d-46a257cf5a10.png) before serialize code: ![image](https://user-images.githubusercontent.com/34299724/75939330-d6e2a500-5ec4-11ea-834e-24571476e2ad.png) the reason is "async"? how to solve it

I cannot easily upgrade to v2 in my project since it is an indirect dependency.

I'd love an option to render functions in modern ES6 and [standardJS](https://standardjs.com) syntax. Eg. instead of ```js const echo = function (arg) { return arg; } ``` I'd want ```js...