MCPcopy
hub / github.com/styled-components/polished / getValueAndUnit

Function getValueAndUnit

src/helpers/getValueAndUnit.js:27–32  ·  view source on GitHub ↗
(value: string | number)

Source from the content-addressed store, hash-verified

25 * }
26 */
27export default function getValueAndUnit(value: string | number): any {
28 if (typeof value !== 'string') return [value, '']
29 const matchedValue = value.match(cssRegex)
30 if (matchedValue) return [parseFloat(value), matchedValue[2]]
31 return [value, undefined]
32}

Callers 6

convertBaseFunction · 0.70
remToPxFunction · 0.70
modularScaleFunction · 0.70
triangleFunction · 0.50
betweenFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…