MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / needsRewrite

Function needsRewrite

packages/parsers/src/rewriteSubCompPaths.ts:31–33  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

29 * is the project root, so they don't need rewriting.
30 */
31function 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

Callers 1

rewriteAssetPathFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected