Style tweak

This commit is contained in:
Michael Jackson 2018-07-19 21:49:39 -04:00
parent b69fd550a2
commit ab3e5f4dfc
1 changed files with 4 additions and 3 deletions

View File

@ -85,11 +85,12 @@ function searchEntries(tarballStream, entryName, wantsHTML) {
// and the client wants HTML.
if (
entry.name === entryName ||
(wantsHTML && entry.name === entryName + "/index.html") ||
// Allow accessing e.g. `/lib/index.html` using `/lib/`
(wantsHTML && entry.name === `${entryName}/index.html`) ||
// Allow accessing e.g. `/index.js` or `/index.json` using
// `/index` for compatibility with CommonJS
(!wantsHTML && entry.name === entryName + ".js") ||
(!wantsHTML && entry.name === entryName + ".json")
(!wantsHTML && entry.name === `${entryName}.js`) ||
(!wantsHTML && entry.name === `${entryName}.json`)
) {
foundEntry = entry;
}