fix(core): Update types for TypeScript nullability support (#15472)
This commit is contained in:

committed by
Victor Berchet

parent
331b9f6425
commit
910c0d9ee7
@ -20,8 +20,11 @@ export function html(html: string): Element {
|
||||
return div;
|
||||
}
|
||||
|
||||
export function multiTrim(text: string): string {
|
||||
return text.replace(/\n/g, '').replace(/\s\s+/g, ' ').trim();
|
||||
export function multiTrim(text: string | null | undefined): string {
|
||||
if (typeof text == 'string') {
|
||||
return text.replace(/\n/g, '').replace(/\s\s+/g, ' ').trim();
|
||||
}
|
||||
throw new Error('Argument can not be undefined.');
|
||||
}
|
||||
|
||||
export function nodes(html: string) {
|
||||
|
Reference in New Issue
Block a user