Remove usage of 'null' in favor of 'undefined'

This commit is contained in:
Keavon Chambers
2022-08-25 21:32:27 -07:00
parent 1e74ccb4f8
commit 33cb6fcb00
21 changed files with 45 additions and 323 deletions
+2 -2
View File
@@ -8,12 +8,12 @@ export type WasmEditorInstance = InstanceType<WasmRawInstance["JsEditorHandle"]>
export type Editor = Readonly<ReturnType<typeof createEditor>>;
// `wasmImport` starts uninitialized because its initialization needs to occur asynchronously, and thus needs to occur by manually calling and awaiting `initWasm()`
let wasmImport: WasmRawInstance | null = null;
let wasmImport: WasmRawInstance | undefined;
// Should be called asynchronously before `createEditor()`
export async function initWasm(): Promise<void> {
// Skip if the WASM module is already initialized
if (wasmImport !== null) return;
if (wasmImport !== undefined) return;
// Import the WASM module JS bindings and wrap them in the panic proxy
wasmImport = await import("@/../wasm/pkg").then(panicProxy);
+3 -3
View File
@@ -82,9 +82,9 @@ export type HintGroup = HintInfo[];
export class HintInfo {
readonly keyGroups!: KeysGroup[];
readonly keyGroupsMac!: KeysGroup[] | null;
readonly keyGroupsMac!: KeysGroup[] | undefined;
readonly mouse!: MouseMotion | null;
readonly mouse!: MouseMotion | undefined;
readonly label!: string;
@@ -669,7 +669,7 @@ export type WidgetLayout = {
export function defaultWidgetLayout(): WidgetLayout {
return {
layoutTarget: null,
layoutTarget: undefined,
layout: [],
};
}