Download node_modules/form-data-encoder/lib/esm/util/isPlainObject.js from HarshvardhanCn01/Voice-Assistant: direct link, hf CLI and curl.
- Browser
- Download file 442 Bytes
-
https://huggingface.co/spaces/HarshvardhanCn01/Voice-Assistant/resolve/main/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
- Command line
-
hf download hf://spaces/HarshvardhanCn01/Voice-Assistant/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
-
curl -L -o isPlainObject.js https://huggingface.co/spaces/HarshvardhanCn01/Voice-Assistant/resolve/main/node_modules/form-data-encoder/lib/esm/util/isPlainObject.js
442 Bytes
| const getType = (value) => (Object.prototype.toString.call(value).slice(8, -1).toLowerCase()); | |
| 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(); | |
| } | |
| export default isPlainObject; | |