Z User
phase7: MCP stdio smoke test (handshake + tools/list + get_roots 6:74) — 4/4 tests PASS
54a6341 Download node_modules/hono/dist/middleware/serve-static/path.js from bravesigma/quran-md-plugin: direct link, hf CLI and curl.
- Browser
- Download file 669 Bytes
-
https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/hono/dist/middleware/serve-static/path.js
- Command line
-
hf download hf://datasets/bravesigma/quran-md-plugin/node_modules/hono/dist/middleware/serve-static/path.js
-
curl -L -o path.js https://huggingface.co/datasets/bravesigma/quran-md-plugin/resolve/main/node_modules/hono/dist/middleware/serve-static/path.js
669 Bytes
| //#region src/middleware/serve-static/path.ts | |
| /** | |
| * `defaultJoin` does not support Windows paths and always uses `/` separators. | |
| * If you need Windows path support, please use `join` exported from `node:path` etc. instead. | |
| */ | |
| const defaultJoin = (...paths) => { | |
| let result = paths.filter((p) => p !== "").join("/"); | |
| result = result.replace(/(?<=\/)\/+/g, ""); | |
| const segments = result.split("/"); | |
| const resolved = []; | |
| for (const segment of segments) if (segment === ".." && resolved.length > 0 && resolved.at(-1) !== "..") resolved.pop(); | |
| else if (segment !== ".") resolved.push(segment); | |
| return resolved.join("/") || "."; | |
| }; | |
| //#endregion | |
| export { defaultJoin }; | |