Comparing version 2.0.1 to 2.1.0
@@ -158,3 +158,3 @@ "use strict"; | ||
// sort by cost to find the lowest one (might be several ties for lowest) | ||
// [4, 6, 7, 1, 2].sort((a, b) => a - b); -> [ 1, 2, 4, 6, 7 ] | ||
// [4, 6, 7, 1, 2].sort((a, b) => a - b) -> [ 1, 2, 4, 6, 7 ] | ||
const best = alternatives.sort((a, b) => a.cost - b.cost)[0]; | ||
@@ -181,3 +181,3 @@ memoized = best; | ||
}; | ||
// padding++; // maybe only if array_operation.index > -1 ? | ||
// padding++ // maybe only if array_operation.index > -1 ? | ||
return [operations.concat(operation), padding + 1]; | ||
@@ -190,3 +190,3 @@ } | ||
}; | ||
// padding--; | ||
// padding-- | ||
return [operations.concat(operation), padding - 1]; | ||
@@ -193,0 +193,0 @@ } |
@@ -17,4 +17,5 @@ "use strict"; | ||
function compareArrays(left, right) { | ||
if (left.length !== right.length) | ||
if (left.length !== right.length) { | ||
return false; | ||
} | ||
return zip(left, right).every(pair => compare(pair[0], pair[1])); | ||
@@ -28,4 +29,5 @@ } | ||
var right_keys = Object.keys(right); | ||
if (!compareArrays(left_keys, right_keys)) | ||
if (!compareArrays(left_keys, right_keys)) { | ||
return false; | ||
} | ||
return left_keys.every(key => compare(left[key], right[key])); | ||
@@ -57,4 +59,5 @@ } | ||
// strict equality handles literals, numbers, and strings (a sufficient but not necessary cause) | ||
if (left === right) | ||
if (left === right) { | ||
return true; | ||
} | ||
// check arrays | ||
@@ -61,0 +64,0 @@ if (Array.isArray(left) && Array.isArray(right)) { |
{ | ||
"name": "rfc6902", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Complete implementation of RFC6902 (patch and diff)", | ||
@@ -29,7 +29,8 @@ "keywords": [ | ||
"scripts": { | ||
"prepare": "tsc -m commonjs -d", | ||
"prepublish": "tsc -m commonjs -d", | ||
"test": "istanbul cover _mocha -- tests/ --compilers js:babel-core/register -R spec", | ||
"posttest": "coveralls < coverage/lcov.info", | ||
"dist": "tsc -m es2015 && rollup index.js --output.format umd --name rfc6902 --output.file dist/rfc6902.js && closure-compiler dist/rfc6902.js > dist/rfc6902.min.js" | ||
"dist": "tsc -m es2015 && rollup index.js --output.format umd --name rfc6902 --output.file dist/rfc6902.js && closure-compiler dist/rfc6902.js > dist/rfc6902.min.js", | ||
"clean": "tsc -m commonjs -d --listEmittedFiles | sed 's/^TSFILE: //' | xargs rm -v" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
67238
1491