Download src/components/features/skills/is-copyable-skill-source.ts from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 604 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/features/skills/is-copyable-skill-source.ts
- Command line
-
hf download hf://SaylorTwift/openhands/src/components/features/skills/is-copyable-skill-source.ts
-
curl -L -o is-copyable-skill-source.ts https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/features/skills/is-copyable-skill-source.ts
604 Bytes
| /** True when `source` is a filesystem path or URL worth copying (not a scope label like "global"). */ | |
| export function isCopyableSkillSource( | |
| source: string | null | undefined, | |
| ): boolean { | |
| const trimmed = source?.trim(); | |
| if (!trimmed) return false; | |
| if (/^https?:\/\//i.test(trimmed)) return true; | |
| if ( | |
| trimmed.startsWith("/") || | |
| trimmed.startsWith("./") || | |
| trimmed.startsWith("../") || | |
| trimmed.startsWith("~") | |
| ) { | |
| return true; | |
| } | |
| if (/^[A-Za-z]:[\\/]/.test(trimmed)) return true; | |
| if (trimmed.includes("/") || trimmed.includes("\\")) return true; | |
| return false; | |
| } | |