From ba8cdea6b477a8d5a1d499348d033fdcec7ae050 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Mon, 1 Aug 2022 13:30:17 +0530 Subject: [PATCH] Use default import if other not found --- src/platform/web/theming/DerivedVariables.ts | 2 +- src/platform/web/theming/shared/color.mjs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/platform/web/theming/DerivedVariables.ts b/src/platform/web/theming/DerivedVariables.ts index 92e5ac20..bc7a8346 100644 --- a/src/platform/web/theming/DerivedVariables.ts +++ b/src/platform/web/theming/DerivedVariables.ts @@ -99,7 +99,7 @@ export class DerivedVariables { } import * as pkg from "off-color"; -const {offColor} = pkg; +const offColor = pkg.offColor ?? pkg.default.offColor; export function tests() { return { diff --git a/src/platform/web/theming/shared/color.mjs b/src/platform/web/theming/shared/color.mjs index d4a15e56..8af76b6b 100644 --- a/src/platform/web/theming/shared/color.mjs +++ b/src/platform/web/theming/shared/color.mjs @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */ import * as pkg from 'off-color'; -const offColor = pkg.offColor; +const offColor = pkg.offColor ?? pkg.default.offColor; export function derive(value, operation, argument, isDark) { const argumentAsNumber = parseInt(argument);