eleventy-plugin-img2picture
Version:
Eleventy plugin to replace <img> using <picture> with resized and optimized images.
16 lines (13 loc) • 311 B
JavaScript
// @ts-check
/**
* Parse string with comma separated numbers into array of numbers
*
* @param {string} str The string to parse
* @returns {number[]} An array of numbers
*/
function parseStringToNumbers(str) {
return str.split(",").map((s) => Number(s));
}
module.exports = {
parseStringToNumbers,
};