source:
node_modules/json-stable-stringify/example/key_cmp.js@
e48199a
Last change on this file since e48199a was d24f17c, checked in by , 15 months ago | |
---|---|
|
|
File size: 201 bytes |
Rev | Line | |
---|---|---|
[d24f17c] | 1 | 'use strict'; |
2 | ||
3 | var stringify = require('../'); | |
4 | ||
5 | var obj = { c: 8, b: [{ z: 6, y: 5, x: 4 }, 7], a: 3 }; | |
6 | var s = stringify(obj, function (a, b) { | |
7 | return b.key.localeCompare(a.key); | |
8 | }); | |
9 | console.log(s); |
Note:
See TracBrowser
for help on using the repository browser.