my-idlers/node_modules/es5-ext/object/is-copy.js
cp6 fd22b0bf58 V2 (Laravel re-make)
V2 (Laravel re-make)
2022-03-06 02:02:12 +11:00

24 lines
596 B
JavaScript
Vendored

"use strict";
var eq = require("./eq")
, value = require("./valid-value")
, keys = Object.keys
, objPropertyIsEnumerable = Object.prototype.propertyIsEnumerable;
module.exports = function (val1, val2) {
var k1, k2;
if (eq(value(val1), value(val2))) return true;
val1 = Object(val1);
val2 = Object(val2);
k1 = keys(val1);
k2 = keys(val2);
if (k1.length !== k2.length) return false;
return k1.every(function (key) {
if (!objPropertyIsEnumerable.call(val2, key)) return false;
return eq(val1[key], val2[key]);
});
};