refactor: use optional chaining / nullish coalescing operator (#35217)
This commit is contained in:
parent
76431ac1fa
commit
34b985c556
5 changed files with 7 additions and 8 deletions
|
@ -9,8 +9,7 @@ let currentlyRunning: {
|
|||
|
||||
// |options.types| can't be empty and must be an array
|
||||
function isValid (options: Electron.SourcesOptions) {
|
||||
const types = options ? options.types : undefined;
|
||||
return Array.isArray(types);
|
||||
return Array.isArray(options?.types);
|
||||
}
|
||||
|
||||
export async function getSources (args: Electron.SourcesOptions) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue