UNPKG

465 BJavaScriptView Raw
1/**
2 *
3 */
4
5module.exports = (nav) => {
6
7 let res = '';
8
9 nav.forEach(item => {
10 const str = '{';
11 if (/^https?.*/.test(item.uri)) {
12 str += `http: ${item.uri},`;
13 } else {
14 str += `md: require("${item.uri}"),`;
15 }
16 str += `label: "${item.label}",`;
17 str += `uri: "${item.uri}"`;
18
19 str += '}';
20
21 res += str + ',';
22 });
23
24 res = `module.exports = [${res}];`;
25
26
27
28}
\No newline at end of file