Skip to content

Commit

Permalink
fix: fix merge options
Browse files Browse the repository at this point in the history
  • Loading branch information
arianrhodsandlot committed Feb 6, 2024
1 parent e660f00 commit e1e46cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion demo/demo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ async function launchCustomRom() {
nostalgist = await Nostalgist.launch({
core: 'fceumm',
rom: await showOpenFilePicker().then(([fileHandle]) => fileHandle.getFile()),
shader: 'crt/crt-easymode',
})
}

Expand Down
7 changes: 3 additions & 4 deletions src/nostalgist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export class Nostalgist {
private emulator: Emulator | undefined

private constructor(options: NostalgistLaunchOptions) {
const mergedOptions = {}
const mergedOptions = { ...Nostalgist.globalOptions, ...options }
merge(mergedOptions, Nostalgist.globalOptions, options)
// @ts-expect-error we cannot infer the final type here
this.options = mergedOptions
}

Expand Down Expand Up @@ -602,13 +601,13 @@ export class Nostalgist {
}

private getRetroarchOption() {
const options = {}
const options = { ...Nostalgist.globalOptions.retroarchConfig, ...this.options.retroarchConfig }
merge(options, Nostalgist.globalOptions.retroarchConfig, this.options.retroarchConfig)
return options as typeof this.options.retroarchConfig
}

private getRetroarchCoreOption() {
const options = {}
const options = { ...Nostalgist.globalOptions.retroarchCoreConfig, ...this.options.retroarchCoreConfig }
merge(options, Nostalgist.globalOptions.retroarchCoreConfig, this.options.retroarchCoreConfig)
return options
}
Expand Down

0 comments on commit e1e46cd

Please sign in to comment.