Download Latest Version v6.0.2 source code.zip (37.3 kB)
Email in envelope

Get an email when there's a new version of Serialize JavaScript

Home / v5.0.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2020-09-09 861 Bytes
v5.0.0.tar.gz 2020-09-09 35.0 kB
v5.0.0.zip 2020-09-09 37.7 kB
Totals: 3 Items   73.6 kB 0

Changelog - Bump mocha from 8.1.2 to 8.1.3 (#96) - Support sparse arrays (#95) - Bump mocha from 8.1.1 to 8.1.2 (#94) - Bump mocha from 8.1.0 to 8.1.1 (#92) - Create Dependabot config file (#91) - Bump mocha from 8.0.1 to 8.1.0 (#90) - Bump lodash from 4.17.15 to 4.17.19 (#89) - Bump mocha from 7.2.0 to 8.0.1 (#88)

Behavior changes for sparse arrays

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

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

var a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
delete a[0];
a.length = 3;
a[5] = 'wat';
serialize(a) // 'Array.prototype.slice.call({"1":2,"2":3,"5":"wat","length":6})'

Thank you @victorporof for this release.

Source: README.md, updated 2020-09-09