Skip to content

Commit

Permalink
Remove unnecessary negative conditional (#135)
Browse files Browse the repository at this point in the history
* Remove unnecessary negative conditional

Negative conditionals are smelly and confusing.

* No negative check globally

Co-authored-by: Thomas Steiner <tomac@google.com>
  • Loading branch information
soulofmischief and tomayac authored Jan 12, 2023
1 parent 5304b99 commit 422c00e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/directory-open.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import supported from './supported.mjs';

const implementation = !supported
? import('./legacy/directory-open.mjs')
: import('./fs-access/directory-open.mjs');
const implementation = supported
? import('./fs-access/directory-open.mjs')
: import('./legacy/directory-open.mjs');

/**
* For opening directories, dynamically either loads the File System Access API
Expand Down
6 changes: 3 additions & 3 deletions src/file-open.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import supported from './supported.mjs';

const implementation = !supported
? import('./legacy/file-open.mjs')
: import('./fs-access/file-open.mjs');
const implementation = supported
? import('./fs-access/file-open.mjs')
: import('./legacy/file-open.mjs');

/**
* For opening files, dynamically either loads the File System Access API module
Expand Down
6 changes: 3 additions & 3 deletions src/file-save.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

import supported from './supported.mjs';

const implementation = !supported
? import('./legacy/file-save.mjs')
: import('./fs-access/file-save.mjs');
const implementation = supported
? import('./fs-access/file-save.mjs')
: import('./legacy/file-save.mjs');

/**
* For saving files, dynamically either loads the File System Access API module
Expand Down

0 comments on commit 422c00e

Please sign in to comment.