Skip to content

Commit

Permalink
Avoid usage of logical nullish assignment for node 14 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-schranz committed Aug 2, 2022
1 parent 47f2036 commit 08dbf36
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/system/keyboard.ts
Expand Up @@ -98,7 +98,7 @@ export class KeyboardHost {
const target = getActiveElementOrBody(config.document)
this.setKeydownTarget(target)

this.pressed[code] ??= {
this.pressed[code] = this.pressed[code] ?? {
keyDef,
unpreventedDefault: false,
}
Expand Down
2 changes: 1 addition & 1 deletion src/system/pointer/index.ts
Expand Up @@ -41,7 +41,7 @@ export class PointerHost {
private registry = {} as Record<string, Device>

get(k: string) {
this.registry[k] ??= new Device()
this.registry[k] = this.registry[k] ?? new Device()
return this.registry[k]
}
})()
Expand Down
2 changes: 1 addition & 1 deletion src/utils/misc/level.ts
Expand Up @@ -16,7 +16,7 @@ declare module '../../setup' {
}

export function setLevelRef(config: Config, level: ApiLevel) {
config[Level] ??= {}
config[Level] = config[Level] ?? {}
config[Level][level] = {}
}

Expand Down

0 comments on commit 08dbf36

Please sign in to comment.