sumba 2.13.0 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +0 -1
- package/lib/collect.js +1 -2
- package/lib/util.js +2 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +1 -0
package/index.js
CHANGED
|
@@ -341,7 +341,6 @@ async function factory (pkgName) {
|
|
|
341
341
|
|
|
342
342
|
checkPathsByRoute = ({ paths = [], method = 'GET', guards = [] }) => {
|
|
343
343
|
const { outmatch } = this.app.lib
|
|
344
|
-
|
|
345
344
|
for (const item of guards) {
|
|
346
345
|
const matchPath = outmatch(item.path)
|
|
347
346
|
for (const path of paths) {
|
package/lib/collect.js
CHANGED
|
@@ -4,7 +4,6 @@ export async function collect ({ type = '', handler, container, file, ns, dir })
|
|
|
4
4
|
const { camelCase, find, isString, isEmpty } = this.app.lib._
|
|
5
5
|
let items = await readConfig(file, { ignoreError: true })
|
|
6
6
|
if (isEmpty(items)) items = []
|
|
7
|
-
|
|
8
7
|
for (let item of items) {
|
|
9
8
|
if (isString(item)) item = { path: item }
|
|
10
9
|
const routeHandler = item.routeHandler
|
|
@@ -14,7 +13,7 @@ export async function collect ({ type = '', handler, container, file, ns, dir })
|
|
|
14
13
|
if (!this.app[rns]) continue
|
|
15
14
|
const isNeg = item.path[0] === '!'
|
|
16
15
|
if (isNeg) item.path = item.path.slice(1)
|
|
17
|
-
item.path = routePath(`${ns}${routeHandler ? ('.' + routeHandler) : ''}:${item.path}
|
|
16
|
+
item.path = routePath(`${ns}${routeHandler ? ('.' + routeHandler) : ''}:${item.path}`, { defFormat: false })
|
|
18
17
|
item.methods = item.methods ?? ['*']
|
|
19
18
|
if (handler) await handler.call(this, item)
|
|
20
19
|
const guards = this[camelCase(`${type} ${isNeg ? 'Neg' : ''} ${container}`)]
|
package/lib/util.js
CHANGED
|
@@ -55,7 +55,8 @@ export function checkNoRouteSetting (req, routes) {
|
|
|
55
55
|
|
|
56
56
|
export function pathsToCheck (req, withHome) {
|
|
57
57
|
const { uniq, without } = this.app.lib._
|
|
58
|
-
|
|
58
|
+
const items = [req.routeOptions.url, req.url]
|
|
59
|
+
return uniq(without(items, undefined, null))
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
export async function checkIconset (req, reply) {
|
package/package.json
CHANGED