From 45bb0fc63be463aae9954089907b9480d076f48b Mon Sep 17 00:00:00 2001 From: Andrea Faggin Date: Sat, 25 May 2019 06:55:53 +0200 Subject: [PATCH] Restore IE11 support (#10) --- index.ts | 3 ++- package.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 238cd67..b21163c 100644 --- a/index.ts +++ b/index.ts @@ -106,7 +106,8 @@ function selectAll(selectors: string, baseElements?: BaseElements): Element[] { // Can be: select.all('selectors') or select.all('selectors', singleElementOrDocument) if (!baseElements || isQueryable(baseElements)) { - return new Array(...(baseElements || document).querySelectorAll(selectors)); + const elements = (baseElements || document).querySelectorAll(selectors); + return Array.apply(null, elements as any) as Element[]; } const all = []; diff --git a/package.json b/package.json index 5e5342c..7590538 100644 --- a/package.json +++ b/package.json @@ -43,6 +43,7 @@ "envs": "browser", "rules": { "valid-jsdoc": 0, + "prefer-spread": 0, "prefer-arrow-callback": 0, "@typescript-eslint/prefer-for-of": 0 }