summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2017-04-12 21:47:49 -0700
committerJeremiah Senkpiel <fishrock123@rocketmail.com>2017-04-25 10:52:01 -0400
commit00842604483e4c2e622dfdb3a97440e07646158f (patch)
treef3346902636a44b6037652523767636bf7e4f2c9 /deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js
parent061c5da010e0d249379618382a499840d38247b8 (diff)
downloadandroid-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.tar.gz
android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.tar.bz2
android-node-v8-00842604483e4c2e622dfdb3a97440e07646158f.zip
deps: upgrade npm to 4.5.0
PR-URL: https://github.com/nodejs/node/pull/12480 Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js')
-rw-r--r--deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js
new file mode 100644
index 0000000000..2dbb39355c
--- /dev/null
+++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/ajv/node_modules/json-stable-stringify/test/cmp.js
@@ -0,0 +1,11 @@
+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}');
+});