Spaces:
Running
Running
File size: 306 Bytes
3d4392e |
1 2 3 4 5 6 7 8 9 |
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
} |