CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes48downloads
isPlainObject.js14 linesDownload Raw Back to esm
1const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());2function isPlainObject(value) {3    if (getType(value) !== "object") {4        return false;5    }6    const pp = Object.getPrototypeOf(value);7    if (pp === null || pp === undefined) {8        return true;9    }10    const Ctor = pp.constructor && pp.constructor.toString();11    return Ctor === Object.toString();12}13export default isPlainObject;14 
basant307/AI_Governance_Project · CoolFace