polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
30 lines (29 loc) • 868 B
JavaScript
import {ArrayUtils as ArrayUtils2} from "./ArrayUtils";
import lodash_cloneDeep from "lodash/cloneDeep";
import lodash_clone from "lodash/clone";
export class ObjectUtils {
static isObject(value) {
var type = typeof value;
return value != null && (type == "object" || type == "function");
}
static isEqual(object0, object1) {
if (this.isObject(object0) && this.isObject(object1)) {
const keys0 = Object.keys(object0);
const keys1 = Object.keys(object1);
if (!ArrayUtils2.isEqual(keys0, keys1)) {
return false;
}
return JSON.stringify(object0) == JSON.stringify(object1);
}
return false;
}
static merge(object0, object1) {
return Object.assign(object0, object1);
}
static clone(value) {
return lodash_clone(value);
}
static cloneDeep(value) {
return lodash_cloneDeep(value);
}
}