Comparing version 6.0.7--beta to 6.0.8--beta
{ | ||
"name": "elm-spa", | ||
"version": "6.0.7--beta", | ||
"version": "6.0.8--beta", | ||
"description": "single page apps made easy", | ||
@@ -5,0 +5,0 @@ "bin": "dist/src/index.js", |
@@ -24,3 +24,3 @@ "use strict"; | ||
Visit ${green(`https://next.elm-spa.dev`)} for more! | ||
Visit ${green(`https://elm-spa.dev`)} for more! | ||
`; |
@@ -9,3 +9,3 @@ "use strict"; | ||
view : View Never | ||
view : View msg | ||
view = | ||
@@ -12,0 +12,0 @@ View.placeholder "${page.join('.')}" |
"use strict"; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const config_1 = __importDefault(require("../config")); | ||
const utils_1 = require("./utils"); | ||
const routeParserOrder = (pages) => [...pages].sort(sorter); | ||
const isHomepage = (list) => list.join('.') === config_1.default.reserved.homepage; | ||
const isDynamic = (piece) => piece.endsWith('_'); | ||
const alphaSorter = (a, b) => a < b ? -1 : b < a ? 1 : 0; | ||
const sorter = (a, b) => { | ||
if (isHomepage(a)) | ||
return -1; | ||
if (isHomepage(b)) | ||
return 1; | ||
if (a.length < b.length) | ||
return -1; | ||
if (a.length > b.length) | ||
return 1; | ||
for (let i in a) { | ||
const [isA, isB] = [isDynamic(a[i]), isDynamic(b[i])]; | ||
if (isA && isB) | ||
return alphaSorter(a[i], b[i]); | ||
if (isA) | ||
return 1; | ||
if (isB) | ||
return -1; | ||
} | ||
return 0; | ||
}; | ||
exports.default = (pages, _options) => ` | ||
@@ -26,3 +54,3 @@ module Gen.Route exposing | ||
routes = | ||
${utils_1.indent(utils_1.routeParserList(pages), 1)} | ||
${utils_1.indent(utils_1.routeParserList(routeParserOrder(pages)), 1)} | ||
@@ -29,0 +57,0 @@ |
{ | ||
"name": "elm-spa", | ||
"version": "6.0.7--beta", | ||
"version": "6.0.8--beta", | ||
"description": "single page apps made easy", | ||
@@ -48,2 +48,2 @@ "bin": "dist/src/index.js", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1118
70176
40