* Returns true only for paths that traverse up with `../`. * Plain relative paths like `assets/foo.svg` are already correct from the * root perspective — the browser resolves them against the served root, which * is the project root, so they don't need rewriting.
(val: string)
| 29 | * is the project root, so they don't need rewriting. |
| 30 | */ |
| 31 | function needsRewrite(val: string): boolean { |
| 32 | return val.startsWith("../") || val === ".."; |
| 33 | } |
| 34 | |
| 35 | /** |
| 36 | * Rewrite a single relative path from a sub-composition's context to the |