Remove obsolete conditional.

This commit is contained in:
Dillon Kearns 2019-08-21 06:56:58 -07:00
parent 1b69602e84
commit 972218e0cb

View File

@ -55,25 +55,22 @@ function generate(scanned) {
pathFragments = pathFragments.replace(/\.[^/.]+$/, "").split(path.sep); pathFragments = pathFragments.replace(/\.[^/.]+$/, "").split(path.sep);
const is404 = pathFragments.length == 1 && pathFragments[0] == "404"; const is404 = pathFragments.length == 1 && pathFragments[0] == "404";
const ext = path.extname(scanned[i].path); const ext = path.extname(scanned[i].path);
if (scanned[i].document) {
// const elmType = pathFragments.map(toPascalCase).join(""); // const elmType = pathFragments.map(toPascalCase).join("");
const elmType = const elmType =
"(PageRoute [ " + "(PageRoute [ " +
pathFragments pathFragments
.filter(fragment => fragment !== "index") .filter(fragment => fragment !== "index")
.map(fragment => `"${fragment}"`) .map(fragment => `"${fragment}"`)
.join(", ") + .join(", ") +
" ])"; " ])";
if (!is404) { if (!is404) {
captureRouteRecord(pathFragments, elmType, routeRecord); captureRouteRecord(pathFragments, elmType, routeRecord);
allRoutes.push(elmType); allRoutes.push(elmType);
urlParser.push(formatUrlParser(elmType, pathFragments)); urlParser.push(formatUrlParser(elmType, pathFragments));
// routeToMetadata.push(formatCaseInstance(elmType, scanned[i].metadata)); // routeToMetadata.push(formatCaseInstance(elmType, scanned[i].metadata));
// routeToExt.push(formatCaseInstance(elmType, ext)); // routeToExt.push(formatCaseInstance(elmType, ext));
// routeToSource.push(formatCaseInstance(elmType, scanned[i].path)); // routeToSource.push(formatCaseInstance(elmType, scanned[i].path));
}
} else {
captureRouteRecord(pathFragments, scanned[i].path, assetsRecord);
} }
} }
return { return {