Download src/plugins/http-path.ts from shimen/shinclaw: direct link, hf CLI and curl.
- Browser
- Download file 413 Bytes
-
https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/plugins/http-path.ts
- Command line
-
hf download hf://spaces/shimen/shinclaw/src/plugins/http-path.ts
-
curl -L -o http-path.ts https://huggingface.co/spaces/shimen/shinclaw/resolve/main/src/plugins/http-path.ts
413 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}`; | |
| } | |