Skip to content

Commit

Permalink
chore: prefer nullish coalescing operator
Browse files Browse the repository at this point in the history
  • Loading branch information
lovebug356 committed Oct 29, 2023
1 parent 5f56294 commit 312ef0f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
});
};
2 changes: 1 addition & 1 deletion src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion src/models/SpecificationFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class Specification {
}

getSource() {
return this.getFilePath() || this.getFileURL();
return this.getFilePath() ?? this.getFileURL();
}

toSourceString() {
Expand Down

0 comments on commit 312ef0f

Please sign in to comment.