Prevent TypeError caused by hint -#

This commit is contained in:
Rummskartoffel 2020-12-03 16:26:15 +01:00
parent f694f6a669
commit bcccb5794c

View file

@ -1149,11 +1149,12 @@ export function pipe_elements(
function toHintablesArray(
hintablesOrElements: Element[] | Hintables[],
): Hintables[] {
if (!hintablesOrElements.length) return []
return "className" in hintablesOrElements[0]
? [{ elements: hintablesOrElements } as Hintables]
: "elements" in hintablesOrElements[0]
? (hintablesOrElements as Hintables[])
: undefined
? (hintablesOrElements as Hintables[])
: []
}
function selectFocusedHint(delay = false) {