From dc8792c1ad1b7b9a02b97338f1c5d9a6feff89ce Mon Sep 17 00:00:00 2001 From: Kuitos Date: Thu, 3 Dec 2020 18:43:20 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=BD=20fix=20typescript=20typing=20erro?= =?UTF-8?q?r=20(#1120)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/sandbox/patchers/dynamicAppend/common.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/sandbox/patchers/dynamicAppend/common.ts b/src/sandbox/patchers/dynamicAppend/common.ts index 7a927ac..85542a1 100644 --- a/src/sandbox/patchers/dynamicAppend/common.ts +++ b/src/sandbox/patchers/dynamicAppend/common.ts @@ -182,7 +182,10 @@ function getOverwrittenAppendChildOrInsertBefore(opts: { (element as HTMLLinkElement).rel === 'stylesheet' && (element as HTMLLinkElement).href; if (linkElementUsingStylesheet) { - const { fetch } = frameworkConfiguration; + const fetch = + typeof frameworkConfiguration.fetch === 'function' + ? frameworkConfiguration.fetch + : frameworkConfiguration.fetch?.fn; stylesheetElement = convertLinkAsStyle( element, (styleElement) => css.process(mountDOM, styleElement, appName),