mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-01 17:27:14 +02:00
8 lines
224 B
TypeScript
8 lines
224 B
TypeScript
export class StringArray<T extends string> extends Array<T> {
|
|
constructor(str: string) {
|
|
super();
|
|
const parsed = str.split(',') as StringArray<T>;
|
|
return parsed.every((i) => typeof i === 'string') ? parsed : [];
|
|
}
|
|
}
|