Package: node-fast-deep-equal Version: 1.0.0-1 Severity: normal Tags: patch
Dear Maintainer, Before upstream was taken over by NSA/Microsoft, there was a newer version of node-fast-deep-equal available upstream. The following patch patches node-fast-deep-equal to that newer version (2.0.1). This newer functionality is depended on by other projects(such as similarly modified/updated versions of node-ajv, which in turn is a possible prerequisite of solving #743404). It seems to pass both lintian and its own tests. (It is unfortunately not a quilt patch, since it's not a matter of patching from an upstream version, since imho you're effectively upstream, now). Changes include bug fixes, performance updates, updated dependencies, and updated tests. See commit log for details: https://notabug.org/themusicgod1/fast-deep-equal/commits/master ) (I've taken liberty to bump the compat while I was at this.) -- System Information: Debian Release: buster/sid APT prefers testing APT policy: (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.18.0-1-amd64 (SMP w/2 CPU cores) Locale: LANG=en_CA.UTF-8, LC_CTYPE=en_CA.UTF-8 (charmap=UTF-8), LANGUAGE=en_CA:en (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages node-fast-deep-equal depends on: ii nodejs 8.11.2~dfsg-1 node-fast-deep-equal recommends no packages. node-fast-deep-equal suggests no packages. -- no debconf information
Only in node-fast-deep-equal-1.0.0/benchmark: .eslintrc.yml diff -r node-fast-deep-equal-1.0.0/benchmark/index.js node-fast-deep-equal-2.0.1/benchmark/index.js 20c20,21 < } --- > }, > 'ramda.equals': require('ramda').equals diff -r node-fast-deep-equal-1.0.0/debian/changelog node-fast-deep-equal-2.0.1/debian/changelog 0a1,6 > node-fast-deep-equal (2.0.1-1) UNRELEASED; urgency=medium > > * New version > > -- Jeff Cliff <jeffrey.cl...@gmail.com> Sun, 07 Oct 2018 17:18:00 +0500 > diff -r node-fast-deep-equal-1.0.0/debian/compat node-fast-deep-equal-2.0.1/debian/compat 1c1 < 9 --- > 10 diff -r node-fast-deep-equal-1.0.0/debian/control node-fast-deep-equal-2.0.1/debian/control 9c9 < , nodejs --- > , nodejs (>= 0.10) Only in node-fast-deep-equal-2.0.1/debian: .debhelper Only in node-fast-deep-equal-2.0.1/debian: debhelper-build-stamp Only in node-fast-deep-equal-2.0.1/debian: files Only in node-fast-deep-equal-2.0.1/debian: node-fast-deep-equal Only in node-fast-deep-equal-2.0.1/debian: node-fast-deep-equal.substvars Only in node-fast-deep-equal-1.0.0/: .eslintrc.yml Only in node-fast-deep-equal-2.0.1/: .git diff -r node-fast-deep-equal-1.0.0/.gitignore node-fast-deep-equal-2.0.1/.gitignore 56a57,60 > # Lock files > package-lock.json > yarn.lock > Only in node-fast-deep-equal-2.0.1/: index.d.ts diff -r node-fast-deep-equal-1.0.0/index.js node-fast-deep-equal-2.0.1/index.js 2a3,6 > var isArray = Array.isArray; > var keyList = Object.keys; > var hasProp = Object.prototype.hasOwnProperty; > 6,15c10,23 < var arrA = Array.isArray(a) < , arrB = Array.isArray(b) < , i; < < if (arrA && arrB) { < if (a.length != b.length) return false; < for (i = 0; i < a.length; i++) < if (!equal(a[i], b[i])) return false; < return true; < } --- > if (a && b && typeof a == 'object' && typeof b == 'object') { > var arrA = isArray(a) > , arrB = isArray(b) > , i > , length > , key; > > if (arrA && arrB) { > length = a.length; > if (length != b.length) return false; > for (i = length; i-- !== 0;) > if (!equal(a[i], b[i])) return false; > return true; > } 17,21c25 < if (arrA != arrB) return false; < < if (a && b && typeof a === 'object' && typeof b === 'object') { < var keys = Object.keys(a); < if (keys.length !== Object.keys(b).length) return false; --- > if (arrA != arrB) return false; 25d28 < if (dateA && dateB) return a.getTime() == b.getTime(); 26a30 > if (dateA && dateB) return a.getTime() == b.getTime(); 30d33 < if (regexpA && regexpB) return a.toString() == b.toString(); 31a35,41 > if (regexpA && regexpB) return a.toString() == b.toString(); > > var keys = keyList(a); > length = keys.length; > > if (length !== keyList(b).length) > return false; 33,34c43,44 < for (i = 0; i < keys.length; i++) < if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false; --- > for (i = length; i-- !== 0;) > if (!hasProp.call(b, keys[i])) return false; 36,37c46,49 < for (i = 0; i < keys.length; i++) < if(!equal(a[keys[i]], b[keys[i]])) return false; --- > for (i = length; i-- !== 0;) { > key = keys[i]; > if (!equal(a[key], b[key])) return false; > } 42c54 < return false; --- > return a!==a && b!==b; diff -r node-fast-deep-equal-1.0.0/package.json node-fast-deep-equal-2.0.1/package.json 3c3 < "version": "1.0.0", --- > "version": "2.0.1", 10c10,11 < "test": "npm run eslint && npm run test-cov" --- > "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts", > "test": "npm run eslint && npm run test-ts && npm run test-cov" 30,31c31,32 < "deep-eql": "^2.0.2", < "deep-equal": "^1.0.1", --- > "deep-eql": "latest", > "deep-equal": "latest", 33c34 < "lodash": "^4.17.4", --- > "lodash": "latest", 35c36 < "nano-equal": "^1.0.1", --- > "nano-equal": "latest", 38,39c39,42 < "shallow-equal-fuzzy": "0.0.2", < "underscore": "^1.8.3" --- > "ramda": "latest", > "shallow-equal-fuzzy": "latest", > "typescript": "^2.6.1", > "underscore": "latest" 50c53,58 < } --- > }, > "files": [ > "index.js", > "index.d.ts" > ], > "types": "index.d.ts" Only in node-fast-deep-equal-1.0.0/: .pc diff -r node-fast-deep-equal-1.0.0/README.md node-fast-deep-equal-2.0.1/README.md 32a33,34 > Node.js v9.11.1: > 34,41c36,44 < fast-deep-equal x 82,915 ops/sec ±0.63% (89 runs sampled) < nano-equal x 50,506 ops/sec ±2.23% (86 runs sampled) < shallow-equal-fuzzy x 14,873 ops/sec ±3.19% (83 runs sampled) < underscore.isEqual x 16,055 ops/sec ±2.29% (85 runs sampled) < lodash.isEqual x 10,740 ops/sec ±1.04% (89 runs sampled) < deep-equal x 12,276 ops/sec ±2.44% (84 runs sampled) < deep-eql x 10,565 ops/sec ±0.89% (90 runs sampled) < assert.deepStrictEqual x 965 ops/sec ±2.99% (81 runs sampled) --- > fast-deep-equal x 226,960 ops/sec ±1.55% (86 runs sampled) > nano-equal x 218,210 ops/sec ±0.79% (89 runs sampled) > shallow-equal-fuzzy x 206,762 ops/sec ±0.84% (88 runs sampled) > underscore.isEqual x 128,668 ops/sec ±0.75% (91 runs sampled) > lodash.isEqual x 44,895 ops/sec ±0.67% (85 runs sampled) > deep-equal x 51,616 ops/sec ±0.96% (90 runs sampled) > deep-eql x 28,218 ops/sec ±0.42% (85 runs sampled) > assert.deepStrictEqual x 1,777 ops/sec ±1.05% (86 runs sampled) > ramda.equals x 13,466 ops/sec ±0.82% (86 runs sampled) Only in node-fast-deep-equal-1.0.0/spec: .eslintrc.yml diff -r node-fast-deep-equal-1.0.0/spec/tests.js node-fast-deep-equal-2.0.1/spec/tests.js 83a84,107 > }, > { > description: 'NaN and NaN are equal', > value1: NaN, > value2: NaN, > equal: true > }, > { > description: '0 and -0 are equal', > value1: 0, > value2: -0, > equal: true > }, > { > description: 'Infinity and Infinity are equal', > value1: Infinity, > value2: Infinity, > equal: true > }, > { > description: 'Infinity and -Infinity are not equal', > value1: Infinity, > value2: -Infinity, > equal: false 167a192,215 > }, > { > description: 'nulls are equal', > value1: null, > value2: null, > equal: true > }, > { > description: 'null and undefined are not equal', > value1: null, > value2: undefined, > equal: false > }, > { > description: 'null and empty object are not equal', > value1: null, > value2: {}, > equal: false > }, > { > description: 'undefined and empty object are not equal', > value1: undefined, > value2: {}, > equal: false 283a332,348 > description: 'functions', > tests: [ > { > description: 'same function is equal', > value1: func1, > value2: func1, > equal: true > }, > { > description: 'different functions are not equal', > value1: func1, > value2: func2, > equal: false > } > ] > }, > { 320a386,388 > > function func1() {} > function func2() {} diff -r node-fast-deep-equal-1.0.0/.travis.yml node-fast-deep-equal-2.0.1/.travis.yml 5d4 < - "7" 6a6,7 > - "9" > - "10"