UNPKG

@googleforcreators/media

Version:

Functionality for creating and working with media resources in the Web Stories editor.

3 lines (2 loc) 453 B
import e from"./aspectRatiosApproximatelyMatch.js";function t(t){return t.sizes?Object.values(t.sizes).sort(((e,t)=>t.width-e.width)).filter((r=>e(r,t))).reduce(((e,t)=>e.length&&e[e.length-1].width===t.width?e:[...e,t]),[]).filter((e=>e&&e.sourceUrl&&e.width)).map((e=>{return`${(t=e.sourceUrl,t.includes("%")?t:encodeURI(t)).replaceAll(",","%2C")} ${e.width}w`;var t})).join(","):null}export{t as default}; //# sourceMappingURL=calculateSrcSet.js.map