Comparing version 0.3.6 to 0.3.7
@@ -146,9 +146,9 @@ 'use strict'; | ||
var rtype = typeof rhs; | ||
if (ltype === 'undefined') { | ||
if (rtype !== 'undefined') { | ||
changes(new DiffNew(currentPath, rhs)); | ||
} else { | ||
changes(new DiffDeleted(currentPath, lhs)); | ||
} | ||
} else if (rtype === 'undefined') { | ||
var ldefined = ltype !== 'undefined' || stack && stack[stack.length - 1].lhs.hasOwnProperty(key); | ||
var rdefined = rtype !== 'undefined' || stack && stack[stack.length - 1].rhs.hasOwnProperty(key); | ||
if (!ldefined && rdefined) { | ||
changes(new DiffNew(currentPath, rhs)); | ||
} else if (!rdefined && ldefined) { | ||
changes(new DiffDeleted(currentPath, lhs)); | ||
@@ -155,0 +155,0 @@ } else if (realTypeOf(lhs) !== realTypeOf(rhs)) { |
18
index.js
@@ -153,9 +153,9 @@ (function (global, factory) { | ||
var rtype = typeof rhs; | ||
if (ltype === 'undefined') { | ||
if (rtype !== 'undefined') { | ||
changes(new DiffNew(currentPath, rhs)); | ||
} else { | ||
changes(new DiffDeleted(currentPath, lhs)); | ||
} | ||
} else if (rtype === 'undefined') { | ||
var ldefined = ltype !== 'undefined' || stack && stack[stack.length - 1].lhs.hasOwnProperty(key); | ||
var rdefined = rtype !== 'undefined' || stack && stack[stack.length - 1].rhs.hasOwnProperty(key); | ||
if (!ldefined && rdefined) { | ||
changes(new DiffNew(currentPath, rhs)); | ||
} else if (!rdefined && ldefined) { | ||
changes(new DiffDeleted(currentPath, lhs)); | ||
@@ -168,4 +168,4 @@ } else if (realTypeOf(lhs) !== realTypeOf(rhs)) { | ||
stack = stack || []; | ||
if (stack.indexOf(lhs) < 0) { | ||
stack.push(lhs); | ||
if (!stack.filter(function (x) { return x.lhs === lhs }).length) { | ||
stack.push({ lhs: lhs, rhs: rhs }); | ||
if (Array.isArray(lhs)) { | ||
@@ -172,0 +172,0 @@ var i, len = lhs.length; |
{ | ||
"name": "deep-diff", | ||
"description": "Javascript utility for calculating deep difference, capturing changes, and applying changes across objects; for nodejs and the browser.", | ||
"version": "0.3.6", | ||
"version": "0.3.7", | ||
"license": "MIT", | ||
@@ -26,2 +26,3 @@ "keywords": [ | ||
"Daniel Spangler <daniel.spangler@gmail.com>", | ||
"Sam Beran <sberan@gmail.com>", | ||
"Thomas de Barochez <thomas.barochez+github@gmail.com>", | ||
@@ -28,0 +29,0 @@ "Morton Fox <github@qslw.com>", |
@@ -15,5 +15,9 @@ # deep-diff [![Build Status](https://travis-ci.org/flitbit/diff.png?branch=master)](https://travis-ci.org/flitbit/diff) | ||
`0.3.7` - 2017-05-01 | ||
* fixed issue #98 by merging @sberan's pull request #99 — better handling of property with `undefined` value existing on either operand. Unit tests supplied. | ||
`0.3.6` - 2017-04-25 — Fixed, closed lingering issues: | ||
* fixed #74 — comparing objects with longer cycles | ||
* fixed #70 — was not properly detecting a deletion when a property on the operand (lhs) had a value of `undefined` and was _undefined_ on the comparand (rhs). :o). | ||
* WARNING! [Still broken when importing in Typescript](https://github.com/flitbit/diff/issues/97). | ||
@@ -24,4 +28,6 @@ `0.3.5` - 2017-04-23 — Rolled up recent fixes; patches: | ||
* @tdebarochez — #90: fixed error when .toString not a function | ||
* @thiamsantos — #92, #93: changed module system for improved es2015 modules | ||
* @thiamsantos — #92, #93: changed module system for improved es2015 modules. WARNING! [This PR broke importing `deep-diff` in Typescript as reported by @kgentes in #97](https://github.com/flitbit/diff/issues/97) | ||
`0.3.4` - Typescript users, reference this version until #97 is fixed! | ||
`0.3.3` - Thanks @SimenB: enabled npm script for release (alternate to the Makefile). Also linting as part of `npm test`. Thanks @joeldenning: Fixed issue #35; diffs of top level arrays now working. | ||
@@ -28,0 +34,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
99503
20
252
903