Skip to content

Commit 264d827

Browse files
committed
(#547) Addressed some sonar issues
1 parent 1538576 commit 264d827

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/generate-output-path.function.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ export const generateOutputPath = (
1414
path?: string;
1515
prefix?: string;
1616
postfix?: string;
17-
}
17+
},
1818
) => {
1919
const name = parse(filename).name;
20-
const imageType = params && params.type ? params.type : FileType.PNG;
21-
const path = params && params.path ? params.path : cwd();
22-
const prefix = params && params.prefix ? params.prefix : "";
23-
const postfix = params && params.postfix ? params.postfix : "";
20+
const imageType = params?.type ? params.type : FileType.PNG;
21+
const path = params?.path ? params.path : cwd();
22+
const prefix = params?.prefix ? params.prefix : "";
23+
const postfix = params?.postfix ? params.postfix : "";
2424
return join(path, `${prefix}${name}${postfix}${imageType}`);
2525
};

lib/screen.class.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ export class ScreenClass {
598598
public on(searchInput: FindInput, callback: FindHookCallback): void {
599599
this.validateSearchInput("on", searchInput);
600600

601-
const existingHooks = this.findHooks.get(searchInput) || [];
601+
const existingHooks = this.findHooks.get(searchInput) ?? [];
602602
this.findHooks.set(searchInput, [...existingHooks, callback]);
603603
this.providerRegistry
604604
.getLogProvider()

0 commit comments

Comments
 (0)