| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -104,13 +104,8 @@ function getConditionsSet(conditions) { | |||
| 104 | 104 | const realpathCache = new SafeMap(); | |
| 105 | 105 | const packageJSONCache = new SafeMap(); /* string -> PackageConfig */ | |
| 106 | 106 | ||
| 107 | - function tryStatSync(path) { | ||
| 108 | - try { | ||
| 109 | - return statSync(path); | ||
| 110 | - } catch { | ||
| 111 | - return new Stats(); | ||
| 112 | - } | ||
| 113 | - } | ||
| 107 | + const tryStatSync = | ||
| 108 | + (path) => statSync(path, { throwIfNoEntry: false }) ?? new Stats(); | ||
| 114 | 109 | ||
| 115 | 110 | function getPackageConfig(path, specifier, base) { | |
| 116 | 111 | const existing = packageJSONCache.get(path); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments