Skip to content

Releases: yahoo/serialize-javascript

v2.1.0

04 Sep 12:35
v2.1.0
31c98ad
Compare
Choose a tag to compare

v2.0.0

04 Sep 12:13
c65dd4a
Compare
Choose a tag to compare
  • re-landed #54 with bump major version (see: #57)

Behavior changes for undefined

It serializes undefined values as follows since this version. The result of serialization may be changed if you are passing undefined values into the serialize-javascript.

v2.x

const serialize = require('serialize-javascript');

serialize({undef: undefined}); // '{"undef":undefined}'

v1.x

const serialize = require('serialize-javascript');

serialize({undef: undefined}); // '{}'

v1.9.1

04 Sep 12:11
9ee6b1c
Compare
Choose a tag to compare
  • Revert #54 for breaking changes (see: #57)
  • Bump mocha from 5.2.0 to 6.2.0 (#56)

v1.9.0

29 Aug 12:40
v1.9.0
84ad59b
Compare
Choose a tag to compare
  • support serialize undefined (@nqdy666, #54)
  • Update Node.js versions to tests

v1.8.0

20 Aug 12:53
v1.8.0
6eae833
Compare
Choose a tag to compare

v1.7.0

16 Apr 12:21
v1.7.0
423a382
Compare
Choose a tag to compare
  • Add support for serializing ES6 sets & maps (@pimterry, #45)

Please note that serialization for ES6 Sets & Maps requires support for Array.from (not available in IE or Node < 0.12), or an Array.from polyfill.

v1.6.1

28 Dec 07:36
v1.6.1
35f6480
Compare
Choose a tag to compare

v1.6.0

24 Dec 14:34
v1.6.0
8c10244
Compare
Choose a tag to compare

v1.4.0

15 Jul 12:47
v1.4.0
Compare
Choose a tag to compare

Improve Perf of Pure JSON Data

31 May 21:57
Compare
Choose a tag to compare

This minor release drastically improves the perf of serializing pure JSON data with the new {isJSON: true} flag. #17

Passing a replacer function to JSON.stringify() slows it down dramatically. If possible, we should avoid this this path, and the new isJSON option is the signal that the object passed-in contains no functions or regexp values. But still protect against XSS by properly escaping for a <script> context.

Node v0.12.10
simpleObj:
JSON.stringify( simpleObj ) x 1,303,349 ops/sec ±0.66% (99 runs sampled)
JSON.stringify( simpleObj ) with replacer x 386,634 ops/sec ±0.72% (96 runs sampled)
serialize( simpleObj ) x 284,535 ops/sec ±0.92% (98 runs sampled)
serialize( simpleObj, {isJSON: true} ) x 951,798 ops/sec ±0.92% (96 runs sampled)