Spaces:
Sleeping
Sleeping
Download src/lib/joinWords.ts from network01/ai-comic-factory: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/lib/joinWords.ts
- Command line
-
hf download hf://spaces/network01/ai-comic-factory/src/lib/joinWords.ts
-
curl -L -o joinWords.ts https://huggingface.co/spaces/network01/ai-comic-factory/resolve/main/src/lib/joinWords.ts
363 Bytes
| // clean a list of words (which may be null, undefined or empty) | |
| // into one clean string of separator-divided (by default comma-separated) words | |
| // the words will be trimmed, and empty elements will be removed | |
| export function joinWords(inputs: any[] = [], separator = ", "): string { | |
| return inputs.map(x => `${x || ""}`.trim()).filter(x => x).join(separator) | |
| } |