@easy-breezy/core
Version:
Command line root module
17 lines (16 loc) • 450 B
JavaScript
export const isObject = (value) => {
return Object.prototype.toString.call(value) === '[object Object]';
};
export const isPlainObject = (value) => {
if (!isObject(value)) {
return false;
}
if (value.constructor === undefined) {
return true;
}
if (!isObject(value.constructor.prototype) ||
!value.constructor.prototype.hasOwnProperty('isPrototypeOf')) {
return false;
}
return true;
};