Don't auto convert , to arrays in env

Fixes #782
This commit is contained in:
rijkvanzanten
2020-10-26 19:38:36 +01:00
parent 005200ef0d
commit 91bfcb875f
3 changed files with 9 additions and 8 deletions

View File

@@ -1,3 +1,8 @@
export function toArray<T = any>(val: T | T[]): T[] {
export function toArray(val: string): string[];
export function toArray(val: any | any[]): any[] {
if (typeof val === 'string') {
return val.split(',');
}
return Array.isArray(val) ? val : [val];
}