Download src/lib/utils/parseStringToList.ts from WOosts/chat-ui: direct link, hf CLI and curl.
- Browser
- Download file 238 Bytes
-
https://huggingface.co/spaces/WOosts/chat-ui/resolve/main/src/lib/utils/parseStringToList.ts
- Command line
-
hf download hf://spaces/WOosts/chat-ui/src/lib/utils/parseStringToList.ts
-
curl -L -o parseStringToList.ts https://huggingface.co/spaces/WOosts/chat-ui/resolve/main/src/lib/utils/parseStringToList.ts
238 Bytes
| export function parseStringToList(links: unknown): string[] { | |
| if (typeof links !== "string") { | |
| throw new Error("Expected a string"); | |
| } | |
| return links | |
| .split(",") | |
| .map((link) => link.trim()) | |
| .filter((link) => link.length > 0); | |
| } | |