Spaces:
Build error
Build error
Download src/lib/joinWords.ts from Henhouse/workflow-comics: direct link, hf CLI and curl.
- Browser
- Download file 363 Bytes
-
https://huggingface.co/spaces/Henhouse/workflow-comics/resolve/main/src/lib/joinWords.ts
- Command line
-
hf download hf://spaces/Henhouse/workflow-comics/src/lib/joinWords.ts
-
curl -L -o joinWords.ts https://huggingface.co/spaces/Henhouse/workflow-comics/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) | |
| } |