Spaces:
Runtime error
Runtime error
Download static/node_modules/mongoose/lib/helpers/omitUndefined.js from kaab4321/NarrativeFlow: direct link, hf CLI and curl.
- Browser
- Download file 405 Bytes
-
https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongoose/lib/helpers/omitUndefined.js
- Command line
-
hf download hf://spaces/kaab4321/NarrativeFlow/static/node_modules/mongoose/lib/helpers/omitUndefined.js
-
curl -L -o omitUndefined.js https://huggingface.co/spaces/kaab4321/NarrativeFlow/resolve/main/static/node_modules/mongoose/lib/helpers/omitUndefined.js
405 Bytes
| ; | |
| module.exports = function omitUndefined(val) { | |
| if (val == null || typeof val !== 'object') { | |
| return val; | |
| } | |
| if (Array.isArray(val)) { | |
| for (let i = val.length - 1; i >= 0; --i) { | |
| if (val[i] === undefined) { | |
| val.splice(i, 1); | |
| } | |
| } | |
| } | |
| for (const key of Object.keys(val)) { | |
| if (val[key] === void 0) { | |
| delete val[key]; | |
| } | |
| } | |
| return val; | |
| }; | |