Skip to content

Commit

Permalink
refactor: prefer Boolean(var) over !!var
Browse files Browse the repository at this point in the history
  • Loading branch information
NikhilNarayana committed Jun 5, 2022
1 parent efe5760 commit c1c4694
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/console/connectionScanner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class ConnectionScanner {
}

public getIsScanning() {
return !!this.server;
return Boolean(this.server);
}

private _handleMessageReceive = (msg: Buffer, rinfo: dgram.RemoteInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ if (isDevelopment) {

const installExtensions = async () => {
const installer = require("electron-devtools-installer");
const forceDownload = !!process.env.UPGRADE_EXTENSIONS;
const forceDownload = Boolean(process.env.UPGRADE_EXTENSIONS);
const extensions = ["REACT_DEVELOPER_TOOLS"];

return installer
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/containers/Console/AddConnectionForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export const AddConnectionForm: React.FC<AddConnectionFormProps> = ({ defaultVal
required={true}
value={isNaN(value) ? "" : value.toString()}
onChange={(e) => onChange(parseInt(e.target.value))}
error={!!error}
error={Boolean(error)}
helperText={error ? error.message : null}
type="number"
disabled={disabled}
Expand Down

0 comments on commit c1c4694

Please sign in to comment.