MCPcopy
hub / github.com/eip-work/kuboard-press / findPageForPath

Function findPageForPath

docker/ClientComputedMixin.js:11–22  ·  view source on GitHub ↗

* Get page data via path (permalink). * * @param {array} pages * @param {string} path * @returns {object}

(pages, path)

Source from the content-addressed store, hash-verified

9 */
10
11function findPageForPath (pages, path) {
12 for (let i = 0; i < pages.length; i++) {
13 const page = pages[i]
14 if (page.path.toLowerCase() === path.toLowerCase()) {
15 return page
16 }
17 }
18 return {
19 path: '',
20 frontmatter: {}
21 }
22}
23
24/**
25 * Expose a function to get ClientComputedMixin constructor.

Callers 1

$pageMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected