Open
Description
May I suggest removing Lodash as a dependency?
The single call to the Lodash isEqual
function could be probably replaced with a simple local implemention:
function isEqual(a: any, b: any) {
if (a === b) {
return true;
}
if (a === null && b === null) {
return true;
}
if (typeof (a) !== typeof (b)) {
return false;
}
if (typeof (a) === 'object') {
// Array
if (Array.isArray(a)) {
if (!Array.isArray(b)) {
return false;
}
if (a.length !== b.length) {
return false;
}
for (let i = 0; i < a.length; i++) {
if (!isEqual(a[i], b[i])) {
return false;
}
}
return true;
}
// Hash table
const keys = Object.keys(a);
if (keys.length !== Object.keys(b).length) {
return false;
}
for (let i = 0; i < keys.length; i++) {
if (!b.hasOwnProperty(keys[i])) {
return false;
}
if (!isEqual(a[keys[i]], b[keys[i]])) {
return false;
}
}
return true;
}
}
Metadata
Metadata
Assignees
Labels
No labels