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

diff-upsert

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

diff-upsert - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

test/confnew.json

2

package.json
{
"name": "diff-upsert",
"version": "0.1.3",
"version": "0.1.4",
"description": "JSON object diff for upsert",

@@ -5,0 +5,0 @@ "main": "index.js",

// mocha -R min --inline-diffs *.js
(typeof describe === 'function') && describe("DiffUpsert", function() {
var should = require("should");
var DiffUpsert = require('../index').DiffUpsert;
const should = require("should");
const fs = require('fs');
const path = require('path');
const DiffUpsert = require('../index').DiffUpsert;

@@ -386,3 +388,17 @@ it("diff(obj,objBase) returns delta with new or updated properties", function() {

});
it("diff(...) can detect a change in a real configuration file", function() {
var confold = JSON.parse(fs.readFileSync(path.join(__dirname, 'confold.json')));
var confnew = JSON.parse(fs.readFileSync(path.join(__dirname, 'confnew.json')));
var du = new DiffUpsert();
var delta = du.diff(confnew, confold);
should.deepEqual(delta, {
switches: {
0: {
pin: '373',
},
},
rbHash: 'c40547f27d9c5af04161117788088880',
});
});
})
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