diff --git a/src/flags.ts b/src/flags.ts index 122bc50b577..9ca21cff9f5 100644 --- a/src/flags.ts +++ b/src/flags.ts @@ -4,6 +4,6 @@ export const watchFlag = (description?: string) => { return Flags.boolean({ default: false, char: 'w', - description: description || 'Enable watch mode', + description: description ?? 'Enable watch mode', }); }; diff --git a/src/globals.ts b/src/globals.ts index b0d5d6113df..47c5acd910f 100644 --- a/src/globals.ts +++ b/src/globals.ts @@ -27,7 +27,7 @@ export type SpecWatcherParams = { export const specWatcher = (params: SpecWatcherParams) => { if (!params.spec.getFilePath()) { return WATCH_MESSAGES.logOnAutoDisable(params.docVersion); } - if (CHOKIDAR_INSTANCE_STORE.get(params.label || '_default')) { return; } + if (CHOKIDAR_INSTANCE_STORE.get(params.label ?? '_default')) { return; } const filePath = params.spec.getFilePath() as string; try { diff --git a/src/models/SpecificationFile.ts b/src/models/SpecificationFile.ts index 4d4fe917bf0..e1c55899266 100644 --- a/src/models/SpecificationFile.ts +++ b/src/models/SpecificationFile.ts @@ -64,7 +64,7 @@ export class Specification { } getSource() { - return this.getFilePath() || this.getFileURL(); + return this.getFilePath() ?? this.getFileURL(); } toSourceString() {