Files
est-frame/node_modules/form-data-encoder/lib/util/isPlainObject.js
2025-10-22 05:38:27 +00:00

13 lines
419 B
JavaScript
Executable File

const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase());
export function isPlainObject(value) {
if (getType(value) !== "object") {
return false;
}
const pp = Object.getPrototypeOf(value);
if (pp === null || pp === undefined) {
return true;
}
const Ctor = pp.constructor && pp.constructor.toString();
return Ctor === Object.toString();
}