ai-tube / src /app /api /parsers /parseStringArray.ts
jbilcke-hf's picture
jbilcke-hf HF staff
upgraded to @aitube/client 0.0.12
f24ad59
raw
history blame
306 Bytes
export function parseStringArray(something: any): string[] {
let result: string[] = []
if (typeof something === "string") {
result = [something]
} else if (Array.isArray(something)) {
result = something.map(thing => typeof thing === "string" ? thing : "").filter(x => x)
}
return result
}