Comparing version 4.5.0 to 4.5.1
import _typeof from 'babel-runtime/helpers/typeof'; | ||
import _toConsumableArray from 'babel-runtime/helpers/toConsumableArray'; | ||
import _extends from 'babel-runtime/helpers/extends'; | ||
/* eslint no-proto: 0 */ | ||
function createArray() { | ||
var arr = []; | ||
arr.__proto__ = new Array(); | ||
arr.__proto__.format = function toString() { | ||
return this.map(function (obj) { | ||
return _extends({}, obj, { | ||
path: obj.path.join(' > ') | ||
}); | ||
}); | ||
}; | ||
arr.__proto__.toString = function toString() { | ||
return JSON.stringify(this.format(), null, 2); | ||
}; | ||
return arr; | ||
} | ||
export default function diff(obj1, obj2) { | ||
var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; | ||
var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; | ||
var diffList = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : []; | ||
var diffList = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : createArray(); | ||
@@ -8,0 +27,0 @@ if (depth <= 0) return diffList; |
@@ -15,2 +15,6 @@ 'use strict'; | ||
var _extends2 = require('babel-runtime/helpers/extends'); | ||
var _extends3 = _interopRequireDefault(_extends2); | ||
exports['default'] = diff; | ||
@@ -20,6 +24,24 @@ | ||
/* eslint no-proto: 0 */ | ||
function createArray() { | ||
var arr = []; | ||
arr.__proto__ = new Array(); | ||
arr.__proto__.format = function toString() { | ||
return this.map(function (obj) { | ||
return (0, _extends3['default'])({}, obj, { | ||
path: obj.path.join(' > ') | ||
}); | ||
}); | ||
}; | ||
arr.__proto__.toString = function toString() { | ||
return JSON.stringify(this.format(), null, 2); | ||
}; | ||
return arr; | ||
} | ||
function diff(obj1, obj2) { | ||
var depth = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 10; | ||
var path = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : []; | ||
var diffList = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : []; | ||
var diffList = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : createArray(); | ||
@@ -26,0 +48,0 @@ if (depth <= 0) return diffList; |
{ | ||
"name": "rc-util", | ||
"version": "4.5.0", | ||
"version": "4.5.1", | ||
"description": "Common Utils For React Component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
75772
2491
0