MCPcopy Create free account
hub / github.com/adobe/react-spectrum / getImageURL

Function getImageURL

packages/dev/parcel-packager-ssg/SSGPackager.js:299–318  ·  view source on GitHub ↗
(image, bundleGraph, bundle)

Source from the content-addressed store, hash-verified

297}
298
299function getImageURL(image, bundleGraph, bundle) {
300 if (!image) {
301 return '';
302 }
303
304 let dep = bundle
305 .getMainEntry()
306 .getDependencies()
307 .find(d => d.id === image);
308 if (!dep) {
309 return '';
310 }
311
312 let resolved = bundleGraph.getReferencedBundle(dep, bundle);
313 if (!resolved) {
314 return '';
315 }
316
317 return urlJoin(resolved.target.publicUrl, resolved.name);
318}

Callers 1

packageFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected