UNPKG

react-native-web-internals

Version:

React Native for Web

14 lines (13 loc) 592 B
const CSS_UNIT_RE = /^[+-]?\d*(?:\.\d+)?(?:[Ee][+-]?\d+)?(%|\w*)/, getUnit = str => str.match(CSS_UNIT_RE)[1], isNumeric = n => !isNaN(parseFloat(n)) && isFinite(n), multiplyStyleLengthValue = (value, multiple) => { if (typeof value == "string") { const number = parseFloat(value) * multiple, unit = getUnit(value); return `${number}${unit}`; } else if (isNumeric(value)) return value * multiple; }; var multiplyStyleLengthValue_default = multiplyStyleLengthValue; export { multiplyStyleLengthValue_default as default }; //# sourceMappingURL=index.mjs.map