Spaces:
Paused
Paused
Download node_modules/arrify/index.js from Huzaifa1313/Prof_app: direct link, hf CLI and curl.
- Browser
- Download file 333 Bytes
-
https://huggingface.co/spaces/Huzaifa1313/Prof_app/resolve/main/node_modules/arrify/index.js
- Command line
-
hf download hf://spaces/Huzaifa1313/Prof_app/node_modules/arrify/index.js
-
curl -L -o index.js https://huggingface.co/spaces/Huzaifa1313/Prof_app/resolve/main/node_modules/arrify/index.js
333 Bytes
| ; | |
| const arrify = value => { | |
| if (value === null || value === undefined) { | |
| return []; | |
| } | |
| if (Array.isArray(value)) { | |
| return value; | |
| } | |
| if (typeof value === 'string') { | |
| return [value]; | |
| } | |
| if (typeof value[Symbol.iterator] === 'function') { | |
| return [...value]; | |
| } | |
| return [value]; | |
| }; | |
| module.exports = arrify; | |