Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

deep-diff

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deep-diff - npm Package Compare versions

Comparing version 0.1.3 to 0.1.4

4

index.js

@@ -91,3 +91,5 @@ ;(function(undefined) {

changes(new DiffEdit(currentPath, lhs, rhs));
} else if (ltype === 'object' && lhs != null) {
} else if (lhs instanceof Date && rhs instanceof Date && ((lhs-rhs) != 0) ) {
changes(new DiffEdit(currentPath, lhs, rhs));
} else if (ltype === 'object' && lhs != null && rhs != null) {
stack = stack || [];

@@ -94,0 +96,0 @@ if (stack.indexOf(lhs) < 0) {

{
"name": "deep-diff",
"description": "Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.",
"version": "0.1.3",
"version": "0.1.4",
"keywords": [

@@ -13,3 +13,4 @@ "diff",

"contributors": [
"SocalNick"
"SocalNick",
"sonstone"
],

@@ -16,0 +17,0 @@ "repository": { "type": "git", "url": "git://github.com/flitbit/diff.git" },

@@ -97,4 +97,28 @@ if (typeof require === 'function') {

it('shows that an object property is changed when it is set to null', function() {
lhs.key = {nested: 'value'};
var diff = deep.diff(lhs, { key: null });
expect(diff).to.be.ok();
expect(diff.length).to.be(1);
expect(diff[0]).to.have.property('kind');
expect(diff[0].kind).to.be('E');
});
});
describe('A target that has a date value', function() {
var lhs = { key: new Date(555555555555) };
it('shows the property is changed with a new date value', function() {
var diff = deep.diff(lhs, { key: new Date(777777777777) });
expect(diff).to.be.ok();
expect(diff.length).to.be(1);
expect(diff[0]).to.have.property('kind');
expect(diff[0].kind).to.be('E');
});
});
describe('When executing in a browser (otherwise these tests are benign)', function() {

@@ -101,0 +125,0 @@

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