Spaces:
Paused
Paused
Download node_modules/@fastify/busboy/lib/utils/basename.js from Huzaifa1313/prof002313: direct link, hf CLI and curl.
- Browser
- Download file 420 Bytes
-
https://huggingface.co/spaces/Huzaifa1313/prof002313/resolve/main/node_modules/%40fastify/busboy/lib/utils/basename.js
- Command line
-
hf download hf://spaces/Huzaifa1313/prof002313/node_modules/@fastify/busboy/lib/utils/basename.js
-
curl -L -o basename.js https://huggingface.co/spaces/Huzaifa1313/prof002313/resolve/main/node_modules/%40fastify/busboy/lib/utils/basename.js
420 Bytes
| module.exports = function basename (path) { | |
| if (typeof path !== 'string') { return '' } | |
| for (var i = path.length - 1; i >= 0; --i) { // eslint-disable-line no-var | |
| switch (path.charCodeAt(i)) { | |
| case 0x2F: // '/' | |
| case 0x5C: // '\' | |
| path = path.slice(i + 1) | |
| return (path === '..' || path === '.' ? '' : path) | |
| } | |
| } | |
| return (path === '..' || path === '.' ? '' : path) | |
| } | |