diff-upsert
Advanced tools
Comparing version 0.1.3 to 0.1.4
{ | ||
"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', | ||
}); | ||
}); | ||
}) | ||
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
27788
8
509
1