How to use parse-srcset - 2 common examples

To help you get started, we’ve selected a few parse-srcset examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Galooshi / happo / packages / happo-target-firefox / src / getUrlsFromSrcset.js View on Github external
export default function getUrlsFromSrcset(value) {
  return parseSrcset(value).map((parsed) => parsed.url);
}
github happo / happo.io / src / findAssetPaths.js View on Github external
doc.querySelectorAll('img[srcset]').forEach((img) => {
    parseSrcset(img.getAttribute('srcset')).forEach((parsed) => {
      imgPaths.push(parsed.url);
    });
  });

parse-srcset

A spec-conformant JavaScript parser for the HTML5 srcset attribute

MIT
Latest version published 7 years ago

Package Health Score

67 / 100
Full package analysis

Popular parse-srcset functions

Similar packages