UNPKG

@typed/content-hash

Version:

Content hash a directory of HTML/JS/CSS files and other static assets

25 lines 722 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.parseSrcSets = void 0; const commaRegex = /,/g; const spaceRegex = /\s/g; function parseSrcSets(srcSet, start) { return srcSet .split(commaRegex) .map((s) => s.trim()) .map((part) => { const [url] = part.split(spaceRegex); const urlStart = srcSet.indexOf(url); const urlEnd = urlStart + url.length; const set = { url: url.trim(), position: { start: start + urlStart, end: start + urlEnd, }, }; return set; }); } exports.parseSrcSets = parseSrcSets; //# sourceMappingURL=parseSrcSets.js.map