Skip to content

Commit

Permalink
v4.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vzaidman committed Apr 21, 2020
1 parent eb34612 commit 3cc1e4e
Show file tree
Hide file tree
Showing 19 changed files with 659 additions and 95 deletions.
103 changes: 92 additions & 11 deletions dist/cjs/whyDidYouRender.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/**
* @welldone-software/why-did-you-render 4.1.0-alpha.1
* @welldone-software/why-did-you-render 4.1.1
* MIT Licensed
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman)
* Generated at 2020-04-18
* Generated at 2020-04-21
*/

'use strict';
Expand All @@ -14,6 +14,7 @@ var _isString = _interopDefault(require('lodash/isString'));
var _reduce = _interopDefault(require('lodash/reduce'));
var _has = _interopDefault(require('lodash/has'));
var _keys = _interopDefault(require('lodash/keys'));
var _isSet = _interopDefault(require('lodash/isSet'));
var _isFunction = _interopDefault(require('lodash/isFunction'));
var _isRegExp = _interopDefault(require('lodash/isRegExp'));
var _isDate = _interopDefault(require('lodash/isDate'));
Expand Down Expand Up @@ -271,6 +272,61 @@ function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

function _createForOfIteratorHelper(o) {
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) {
var i = 0;

var F = function () {};

return {
s: F,
n: function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
},
e: function (e) {
throw e;
},
f: F
};
}

throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

var it,
normalCompletion = true,
didErr = false,
err;
return {
s: function () {
it = o[Symbol.iterator]();
},
n: function () {
var step = it.next();
normalCompletion = step.done;
return step;
},
e: function (e) {
didErr = true;
err = e;
},
f: function () {
try {
if (!normalCompletion && it.return != null) it.return();
} finally {
if (didErr) throw err;
}
}
};
}

var diffTypes = {
'different': 'different',
'deepEquals': 'deepEquals',
Expand Down Expand Up @@ -565,7 +621,7 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
var length = a.length;

if (length !== b.length) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return trackDiff(_toConsumableArray(a), _toConsumableArray(b), diffsAccumulator, pathString, diffTypes.different);
}

var allChildrenDeepEqual = true;
Expand All @@ -576,11 +632,36 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
}
}

return allChildrenDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return allChildrenDeepEqual ? trackDiff(_toConsumableArray(a), _toConsumableArray(b), diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(_toConsumableArray(a), _toConsumableArray(b), diffsAccumulator, pathString, diffTypes.different);
}

if (_isSet(a) && _isSet(b)) {
if (a.size !== b.size) {
return trackDiff(new Set(a), new Set(b), diffsAccumulator, pathString, diffTypes.different);
}

var _iterator = _createForOfIteratorHelper(a),
_step;

try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var valA = _step.value;

if (!b.has(valA)) {
return trackDiff(new Set(a), new Set(b), diffsAccumulator, pathString, diffTypes.different);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}

return trackDiff(new Set(a), new Set(b), diffsAccumulator, pathString, diffTypes.deepEquals);
}

if (_isDate(a) && _isDate(b)) {
return a.getTime() === b.getTime() ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.date) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return a.getTime() === b.getTime() ? trackDiff(new Date(a), new Date(b), diffsAccumulator, pathString, diffTypes.date) : trackDiff(new Date(a), new Date(b), diffsAccumulator, pathString, diffTypes.different);
}

if (_isRegExp(a) && _isRegExp(b)) {
Expand All @@ -594,10 +675,10 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
if (isReactElement(a) && isReactElement(b)) {
if (a.type !== b.type) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
} else {
var reactElementPropsAreDeepEqual = accumulateDeepEqualDiffs(a.props, b.props, diffsAccumulator, "".concat(pathString, ".props"));
return reactElementPropsAreDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.reactElement) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
}

var reactElementPropsAreDeepEqual = accumulateDeepEqualDiffs(a.props, b.props, diffsAccumulator, "".concat(pathString, ".props"));
return reactElementPropsAreDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.reactElement) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
}

if (_isFunction(a) && _isFunction(b)) {
Expand All @@ -610,12 +691,12 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
var _length = keys.length;

if (_length !== _keys(b).length) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.different);
}

for (var _i = _length; _i-- !== 0;) {
if (!_has(b, keys[_i])) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.different);
}
}

Expand All @@ -629,7 +710,7 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
}
}

return _allChildrenDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return _allChildrenDeepEqual ? trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.different);
}

return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
Expand Down
6 changes: 3 additions & 3 deletions dist/cjs/whyDidYouRender.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/cjs/whyDidYouRender.min.js.map

Large diffs are not rendered by default.

103 changes: 92 additions & 11 deletions dist/esm/whyDidYouRender.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
/**
* @welldone-software/why-did-you-render 4.1.0-alpha.1
* @welldone-software/why-did-you-render 4.1.1
* MIT Licensed
* Generated by Vitali Zaidman <vzaidman@gmail.com> (https://github.com/vzaidman)
* Generated at 2020-04-18
* Generated at 2020-04-21
*/

import _get$1 from 'lodash/get';
import _isString from 'lodash/isString';
import _reduce from 'lodash/reduce';
import _has from 'lodash/has';
import _keys from 'lodash/keys';
import _isSet from 'lodash/isSet';
import _isFunction from 'lodash/isFunction';
import _isRegExp from 'lodash/isRegExp';
import _isDate from 'lodash/isDate';
Expand Down Expand Up @@ -267,6 +268,61 @@ function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

function _createForOfIteratorHelper(o) {
if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) {
if (Array.isArray(o) || (o = _unsupportedIterableToArray(o))) {
var i = 0;

var F = function () {};

return {
s: F,
n: function () {
if (i >= o.length) return {
done: true
};
return {
done: false,
value: o[i++]
};
},
e: function (e) {
throw e;
},
f: F
};
}

throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}

var it,
normalCompletion = true,
didErr = false,
err;
return {
s: function () {
it = o[Symbol.iterator]();
},
n: function () {
var step = it.next();
normalCompletion = step.done;
return step;
},
e: function (e) {
didErr = true;
err = e;
},
f: function () {
try {
if (!normalCompletion && it.return != null) it.return();
} finally {
if (didErr) throw err;
}
}
};
}

var diffTypes = {
'different': 'different',
'deepEquals': 'deepEquals',
Expand Down Expand Up @@ -561,7 +617,7 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
var length = a.length;

if (length !== b.length) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return trackDiff(_toConsumableArray(a), _toConsumableArray(b), diffsAccumulator, pathString, diffTypes.different);
}

var allChildrenDeepEqual = true;
Expand All @@ -572,11 +628,36 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
}
}

return allChildrenDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return allChildrenDeepEqual ? trackDiff(_toConsumableArray(a), _toConsumableArray(b), diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(_toConsumableArray(a), _toConsumableArray(b), diffsAccumulator, pathString, diffTypes.different);
}

if (_isSet(a) && _isSet(b)) {
if (a.size !== b.size) {
return trackDiff(new Set(a), new Set(b), diffsAccumulator, pathString, diffTypes.different);
}

var _iterator = _createForOfIteratorHelper(a),
_step;

try {
for (_iterator.s(); !(_step = _iterator.n()).done;) {
var valA = _step.value;

if (!b.has(valA)) {
return trackDiff(new Set(a), new Set(b), diffsAccumulator, pathString, diffTypes.different);
}
}
} catch (err) {
_iterator.e(err);
} finally {
_iterator.f();
}

return trackDiff(new Set(a), new Set(b), diffsAccumulator, pathString, diffTypes.deepEquals);
}

if (_isDate(a) && _isDate(b)) {
return a.getTime() === b.getTime() ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.date) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return a.getTime() === b.getTime() ? trackDiff(new Date(a), new Date(b), diffsAccumulator, pathString, diffTypes.date) : trackDiff(new Date(a), new Date(b), diffsAccumulator, pathString, diffTypes.different);
}

if (_isRegExp(a) && _isRegExp(b)) {
Expand All @@ -590,10 +671,10 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
if (isReactElement(a) && isReactElement(b)) {
if (a.type !== b.type) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
} else {
var reactElementPropsAreDeepEqual = accumulateDeepEqualDiffs(a.props, b.props, diffsAccumulator, "".concat(pathString, ".props"));
return reactElementPropsAreDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.reactElement) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
}

var reactElementPropsAreDeepEqual = accumulateDeepEqualDiffs(a.props, b.props, diffsAccumulator, "".concat(pathString, ".props"));
return reactElementPropsAreDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.reactElement) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
}

if (_isFunction(a) && _isFunction(b)) {
Expand All @@ -606,12 +687,12 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
var _length = keys.length;

if (_length !== _keys(b).length) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.different);
}

for (var _i = _length; _i-- !== 0;) {
if (!_has(b, keys[_i])) {
return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.different);
}
}

Expand All @@ -625,7 +706,7 @@ function accumulateDeepEqualDiffs(a, b, diffsAccumulator) {
}
}

return _allChildrenDeepEqual ? trackDiff(a, b, diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
return _allChildrenDeepEqual ? trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.deepEquals) : trackDiff(_objectSpread2({}, a), _objectSpread2({}, b), diffsAccumulator, pathString, diffTypes.different);
}

return trackDiff(a, b, diffsAccumulator, pathString, diffTypes.different);
Expand Down
6 changes: 3 additions & 3 deletions dist/esm/whyDidYouRender.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/esm/whyDidYouRender.min.js.map

Large diffs are not rendered by default.

0 comments on commit 3cc1e4e

Please sign in to comment.