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

Function tryResolveExternal

packages/cli/src/utils/publishProject.ts:214–228  ·  view source on GitHub ↗
(
  ctx: ExternalAssetContext,
  rawPath: string,
  referrerAbsDir: string,
)

Source from the content-addressed store, hash-verified

212}
213
214function tryResolveExternal(
215 ctx: ExternalAssetContext,
216 rawPath: string,
217 referrerAbsDir: string,
218): string | null {
219 if (isNonRelativeUrl(rawPath)) return null;
220 const absPath = resolve(referrerAbsDir, rawPath);
221 if (isPathInside(absPath, ctx.absProjectDir)) return null;
222 try {
223 if (!existsSync(absPath) || !statSync(absPath).isFile()) return null;
224 } catch {
225 return null;
226 }
227 return addExternalAsset(ctx, absPath);
228}
229
230function rewriteCssUrls(
231 ctx: ExternalAssetContext,

Callers 2

rewriteCssUrlsFunction · 0.85
rewriteHtmlAttributesFunction · 0.85

Calls 4

isNonRelativeUrlFunction · 0.85
resolveFunction · 0.85
addExternalAssetFunction · 0.85
isPathInsideFunction · 0.50

Tested by

no test coverage detected