PHP 8.2.30
Preview: cmp.js Size: 335 B
/home/byroehnu/easepaybiz.easetack.com/node_modules/json-stable-stringify-without-jsonify/test/cmp.js

var test = require('tape');
var stringify = require('../');

test('custom comparison function', function (t) {
    t.plan(1);
    var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
    var s = stringify(obj, function (a, b) {
        return a.key < b.key ? 1 : -1;
    });
    t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}');
});

Directory Contents

Dirs: 0 × Files: 7

Name Size Perms Modified Actions
127 B lr--r--r-- 2026-03-14 01:49:06
Edit Download
335 B lrw-r--r-- 2026-03-05 00:20:03
Edit Download
1.10 KB lrw-r--r-- 2026-03-05 00:20:03
Edit Download
1.70 KB lrw-r--r-- 2026-03-05 00:20:04
Edit Download
1.40 KB lrw-r--r-- 2026-03-05 00:20:05
Edit Download
758 B lrw-r--r-- 2026-03-05 00:20:05
Edit Download
574 B lrw-r--r-- 2026-03-05 00:20:06
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).