nuxt-cms-engine
Advanced tools
Comparing version 4.0.2 to 4.0.3
@@ -5,2 +5,4 @@ # Changelog | ||
### [4.0.3](https://github.com/exoort/nuxt-cms-engine/compare/v4.0.2...v4.0.3) (2022-08-17) | ||
### [4.0.2](https://github.com/exoort/nuxt-cms-engine/compare/v4.0.1...v4.0.2) (2022-07-16) | ||
@@ -7,0 +9,0 @@ |
@@ -16,5 +16,5 @@ function checkIsObject (value) { | ||
static getPageConfig (url, config) { | ||
let searched = config.pages[url] | ||
if (!searched) { | ||
if (config.pages[url]) { | ||
return config.pages[url] | ||
} else { | ||
const splittedUrl = CmsEngineUtils.getFullUrlParts(url, URL_SPLIT_LIMIT) | ||
@@ -24,3 +24,18 @@ | ||
for (const pageUrl in config.pages) { | ||
const sortedPages = Object.keys(config.pages).sort((next, prev) => { | ||
const nextLength = config.pages[next].detectBy.length | ||
const prevLength = config.pages[prev].detectBy.length | ||
if (nextLength < prevLength) { | ||
return 1 | ||
} | ||
if (nextLength > prevLength) { | ||
return -1 | ||
} | ||
return 0 | ||
}) | ||
for (const pageUrl of sortedPages) { | ||
const pageUrlLength = config.pages[pageUrl].fullUrlParts.length | ||
@@ -42,3 +57,3 @@ const detectByCount = config.pages[pageUrl].detectBy.length | ||
if (matchedCount === detectByCount) { | ||
searched = config.pages[pageUrl] | ||
return config.pages[pageUrl] || null | ||
} | ||
@@ -48,4 +63,2 @@ } | ||
} | ||
return searched || null | ||
} | ||
@@ -52,0 +65,0 @@ |
{ | ||
"name": "nuxt-cms-engine", | ||
"version": "4.0.2", | ||
"version": "4.0.3", | ||
"description": "CMS engine for nuxt framework", | ||
@@ -49,2 +49,3 @@ "keywords": [ | ||
"@nuxt/types": "^2.15.8", | ||
"@nuxtjs/axios": "^5.13.6", | ||
"@nuxtjs/eslint-config": "latest", | ||
@@ -54,8 +55,9 @@ "@nuxtjs/module-test-utils": "latest", | ||
"babel-jest": "latest", | ||
"core-js": "^3.24.0", | ||
"eslint": "latest", | ||
"husky": "latest", | ||
"jest": "latest", | ||
"nuxt-edge": "latest", | ||
"nuxt": "2.15.8", | ||
"standard-version": "latest", | ||
"@nuxtjs/axios": "^5.13.6" | ||
"ufo": "^0.8.5" | ||
}, | ||
@@ -62,0 +64,0 @@ "publishConfig": { |
30748
509
18