From d75b28315b699bc8ae3fb4954fa848c9b1271d89 Mon Sep 17 00:00:00 2001 From: MrChocolatine <47531779+MrChocolatine@users.noreply.github.com> Date: Sun, 5 Nov 2023 22:33:55 +0000 Subject: [PATCH] chore: improve initializer's types --- addon/initializers/export-application-global.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addon/initializers/export-application-global.ts b/addon/initializers/export-application-global.ts index 89a84150..0b0775d8 100644 --- a/addon/initializers/export-application-global.ts +++ b/addon/initializers/export-application-global.ts @@ -4,9 +4,9 @@ import { classify } from '@ember/string' export function initialize(application: Application): void { const env = application.resolveRegistration('config:environment') as { embedded?: { - delegateStart: boolean + delegateStart?: undefined | boolean } - exportApplicationGlobal: boolean | string + exportApplicationGlobal?: undefined | boolean | string modulePrefix: string } @@ -28,12 +28,12 @@ export function initialize(application: Application): void { return } - const value = env.exportApplicationGlobal + const { exportApplicationGlobal } = env let globalName - if (typeof value === 'string') { - globalName = value + if (typeof exportApplicationGlobal === 'string') { + globalName = exportApplicationGlobal } else { globalName = classify(env.modulePrefix) }