Spaces:
Paused
Paused
Download src/plugins/http-path.ts from amos-fernandes/melbot: direct link, hf CLI and curl.
- Browser
- Download file 399 Bytes
-
https://huggingface.co/spaces/amos-fernandes/melbot/resolve/main/src/plugins/http-path.ts
- Command line
-
hf download hf://spaces/amos-fernandes/melbot/src/plugins/http-path.ts
-
curl -L -o http-path.ts https://huggingface.co/spaces/amos-fernandes/melbot/resolve/main/src/plugins/http-path.ts
399 Bytes
| export function normalizePluginHttpPath( | |
| path?: string | null, | |
| fallback?: string | null, | |
| ): string | null { | |
| const trimmed = path?.trim(); | |
| if (!trimmed) { | |
| const fallbackTrimmed = fallback?.trim(); | |
| if (!fallbackTrimmed) return null; | |
| return fallbackTrimmed.startsWith("/") ? fallbackTrimmed : `/${fallbackTrimmed}`; | |
| } | |
| return trimmed.startsWith("/") ? trimmed : `/${trimmed}`; | |
| } | |