mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08: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 : [];
|
||
|
}
|
||
|
}
|