lint
This commit is contained in:
@@ -6,7 +6,7 @@ module.exports = function currentProductTree (req, res, next) {
|
||||
|
||||
req.context.currentProductTree = currentSiteTree.childPages.find(page => {
|
||||
// Find a product path that matches at least an initial part of the current path
|
||||
const regex = new RegExp(`^${page.href}($|\/)`, 'm')
|
||||
const regex = new RegExp(`^${page.href}($|/)`, 'm')
|
||||
return regex.test(req.context.currentPath)
|
||||
})
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ module.exports = async function genericToc (req, res, next) {
|
||||
function findPageInSiteTree (pageArray, currentPath) {
|
||||
const childPage = pageArray.find(page => {
|
||||
// Find a page that matches at least an initial part of the current path
|
||||
const regex = new RegExp(`^${page.href}($|\/)`, 'm')
|
||||
const regex = new RegExp(`^${page.href}($|/)`, 'm')
|
||||
return regex.test(currentPath)
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user