/
Zertmark
/
site_for_practice
Обзор
Документация
Войти
/
Zertmark
/
site_for_practice
Код
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
master
node_modules/form-data-encoder/lib/util/isPlainObject.js
12 строк
419 B
zertmark
Github Pages setup
23 апр 2025, 15:06
23 апр 2025, 15:06
93ee661
Код
Авторство
О чём код?
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(); }