Files
agency/.pnpm-store/v3/files/2a/347c320821f77c5b0abdcf946214140098250d22fe4f901844114a1f394d2e8bc1972c12c76a91309e0efccbf142c244291812dd19c60d418f1ce6b4ec1f3b
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

14 lines
350 B
Plaintext

'use strict';
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}');
});