refactor(web): use nullish coalescing operator
This commit is contained in:
parent
a866eb5dd0
commit
5272b6b908
1 changed files with 1 additions and 4 deletions
|
|
@ -10,10 +10,7 @@ export let Module: MainModule | null = null;
|
|||
* Initialize the Tree-sitter Wasm module. This should only be called by the {@link Parser} class via {@link Parser.init}.
|
||||
*/
|
||||
export async function initializeBinding(moduleOptions?: Partial<EmscriptenModule>): Promise<MainModule> {
|
||||
if (!Module) {
|
||||
Module = await createModule(moduleOptions);
|
||||
}
|
||||
return Module;
|
||||
return Module ??= await createModule(moduleOptions);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue