Add a check to stringSplit that gives a nicer error message is a non-string is passed.
This commit is contained in:
parent
2360df4258
commit
b5672d676f
|
@ -131,6 +131,9 @@ export function stringSplit(value: string | string[]) {
|
|||
if (value == null || Array.isArray(value)) {
|
||||
return value || []
|
||||
}
|
||||
if (typeof value !== "string") {
|
||||
throw new Error(`Unable to split value of type ${typeof value}: ${value}`)
|
||||
}
|
||||
if (value.split("\n").length > 1) {
|
||||
value = value.split("\n")
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue