(path)
| 545 | } |
| 546 | |
| 547 | function pathToMetadata(path) { |
| 548 | let components = path.substring(1).split("/"); |
| 549 | let info = {title: decodePrettyComponent(components.shift())} |
| 550 | for (let i = 0; i < components.length; i+=2) { |
| 551 | let key = components[i]; |
| 552 | let value = components[i+1]; |
| 553 | if (!value) continue; |
| 554 | if (key == "d") { value = decodePrettyComponent(value); } |
| 555 | else if (value.includes("%")) { value = decodeURIComponent(value); } |
| 556 | if (key.length && value.length) info[key] = value; |
| 557 | } |
| 558 | return info; |
| 559 | } |
| 560 | |
| 561 | function metadataToPath(data) { |
| 562 | if (!data || !data.title) return "/"; |
nothing calls this directly
no test coverage detected