Fix split (with unknown)
This commit is contained in:
parent
32ee7ef17f
commit
8ca090f5b6
@ -32,9 +32,9 @@ interface UrlState {
|
||||
|
||||
function textToParts (text: string): [string, string, string] {
|
||||
const [first, remainder] = text.replace(')', '').split(' (');
|
||||
const [middle, last] = remainder.split(', ');
|
||||
const [middle, last] = (remainder || '').split(', ');
|
||||
|
||||
return [first, middle, last];
|
||||
return [first, middle || '', last || ''];
|
||||
}
|
||||
|
||||
function isValidUrl (url: string): boolean {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user