Skip to content

Commit

Permalink
fix(bundle-source): Avoid ?? operator for RESM
Browse files Browse the repository at this point in the history
  • Loading branch information
kriskowal committed Dec 19, 2023
1 parent aaacdd4 commit c1e4983
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/bundle-source/src/is-entrypoint.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import url from 'url';
import process from 'process';
import fs from 'fs';

const favor = (primary, secondary) =>
typeof primary === 'undefined' ? secondary : primary;

// FIXME: Should maybe be exported by '@endo/something'?
export const isEntrypoint = href =>
String(href) ===
url.pathToFileURL(fs.realpathSync(process.argv[1]) ?? '/').href;
url.pathToFileURL(fs.realpathSync(favor(process.argv[1]), '/')).href;

0 comments on commit c1e4983

Please sign in to comment.