add null check

This commit is contained in:
Mads Rasmussen
2024-02-05 21:41:16 +01:00
parent 9e424a2db3
commit becdaa8817

View File

@@ -15,6 +15,7 @@
* // customDelimiterResult: ['apple', 'orange', 'banana']
*/
export function splitStringToArray(string: string, split: string = ','): string[] {
if (!string) return [];
return (
string
.split(split)