Sha256: 9f4226c99dadc75838025a79ef44f1b45f5ed0a5ca78de895ea3b1de009a12eb
Contents?: true
Size: 350 Bytes
Versions: 148
Compression:
Stored size: 350 Bytes
Contents
'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}'); });
Version data entries
148 entries across 147 versions & 18 rubygems