New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

baseliner

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

baseliner - npm Package Compare versions

Comparing version 1.0.1 to 1.0.2

2

package.json
{
"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);
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc