function findNavPath()

in site-ui/gulp.d/tasks/build-preview-pages.js [174:185]


function findNavPath (currentUrl, node = [], current_path = [], root = true) {
  for (const item of node) {
    const { url, items } = item
    if (url === currentUrl) {
      return current_path.concat(item)
    } else if (items) {
      const activePath = findNavPath(currentUrl, items, current_path.concat(item), false)
      if (activePath) return activePath
    }
  }
  if (root) return []
}