const separator = /[\s,]+/; function flipFromString(custom, flip) { flip.split(separator).forEach((str) => { const value = str.trim(); switch (value) { case "horizontal": custom.hFlip = true; break; case "vertical": custom.vFlip = true; break; } }); } function alignmentFromString(custom, align) { align.split(separator).forEach((str) => { const value = str.trim(); switch (value) { case "left": case "center": case "right": custom.hAlign = value; break; case "top": case "middle": case "bottom": custom.vAlign = value; break; case "slice": case "crop": custom.slice = true; break; case "meet": custom.slice = false; } }); } export { alignmentFromString, flipFromString };