Skip to content

Commit

Permalink
moved @sberan`s contributions to index.es.js, release 0.3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillip Clark committed May 1, 2017
1 parent 799707a commit f6f2e2a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 13 deletions.
3 changes: 3 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@

## ChangeLog

`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).
Expand Down
3 changes: 2 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "deep-diff",
"main": "index.js",
"version": "0.3.6",
"version": "0.3.7",
"homepage": "https://github.com/flitbit/diff",
"authors": [
"Phillip Clark <[email protected]>",
Expand All @@ -17,6 +17,7 @@
"ZauberNerd <[email protected]>",
"ravishivt <[email protected]>",
"Daniel Spangler <[email protected]>",
"Sam Beran <[email protected]>",
"Thomas de Barochez <[email protected]>",
"Morton Fox <[email protected]>",
"Amila Welihinda <[email protected]>",
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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",
"keywords": [
"diff",
Expand Down
14 changes: 7 additions & 7 deletions index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ function deepDiff(lhs, rhs, changes, prefilter, path, key, stack) {

var ltype = typeof lhs;
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));
} else if (realTypeOf(lhs) !== realTypeOf(rhs)) {
changes(new DiffEdit(currentPath, lhs, rhs));
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,8 @@ function deepDiff(lhs, rhs, changes, prefilter, path, key, stack) {
var ltype = typeof lhs;
var rtype = typeof rhs;

var ldefined = ltype !== 'undefined' || stack && stack[stack.length - 1].lhs.hasOwnProperty(key)
var rdefined = rtype !== 'undefined' || stack && stack[stack.length - 1].rhs.hasOwnProperty(key)
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));
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"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",
"keywords": [
"diff",
Expand All @@ -23,6 +23,7 @@
"ZauberNerd <[email protected]>",
"ravishivt <[email protected]>",
"Daniel Spangler <[email protected]>",
"Sam Beran <[email protected]>",
"Thomas de Barochez <[email protected]>",
"Morton Fox <[email protected]>",
"Amila Welihinda <[email protected]>",
Expand Down
1 change: 1 addition & 0 deletions releases/deep-diff-0.3.7.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion test/tests.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
};
DeepDiffConflict = DeepDiff;
</script>
<script src="../releases/deep-diff-0.3.6.min.js"></script>
<script src="../releases/deep-diff-0.3.7.min.js"></script>
<!--script src="../index.js"></script-->
<script>
mocha.setup('bdd');
Expand Down

0 comments on commit f6f2e2a

Please sign in to comment.