Skip to content

Commit

Permalink
chore: improve initializer's types
Browse files Browse the repository at this point in the history
  • Loading branch information
MrChocolatine committed Nov 5, 2023
1 parent dfcaa13 commit d75b283
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions addon/initializers/export-application-global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand All @@ -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)
}
Expand Down

0 comments on commit d75b283

Please sign in to comment.