Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "baseliner", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "compare objects with ease", | ||
@@ -5,0 +5,0 @@ "main": "build/index.js", |
const compareToBaseline = (baseline, otherObject, field, compareFcn) => { | ||
return compareFcn(baseline[(field, otherObject[field])]); | ||
return compareFcn(baseline[field], otherObject[field]); | ||
}; | ||
export default compareToBaseline; |
import baseliner from "../src"; | ||
it("should compare two objects for equality", () => { | ||
const left = { a: 13 }; | ||
const right = { a: 13 }; | ||
const base = { a: 13 }; | ||
const obj1 = { a: 13 }; | ||
const obj2 = { a: 17 }; | ||
const fcn = (x, y) => x === y; | ||
expect(baseliner(left, right, "a", fcn)).toEqual(true); | ||
expect(baseliner(base, obj1, "a", fcn)).toEqual(true); | ||
expect(baseliner(base, obj2, "a", fcn)).toEqual(false); | ||
}); |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
1985
41
0