(text: string)
| 96 | // properties is faster than using more specific regex |
| 97 | // https://jsperf.com/cssparse |
| 98 | function parseTransformString(text: string): Transformation[] { |
| 99 | const matches: Transformation[] = []; |
| 100 | let match: RegExpExecArray; |
| 101 | |
| 102 | while ((match = TRANSFORM_SPLITTER.exec(text)) !== null) { |
| 103 | const property = match[1]; |
| 104 | |
| 105 | if (isTransformType(property)) { |
| 106 | const value = convertTransformValue(property, match[2]); |
| 107 | matches.push(STYLE_TRANSFORMATION_MAP[property](value)); |
| 108 | } |
| 109 | } |
| 110 | |
| 111 | return matches; |
| 112 | } |
| 113 | |
| 114 | function convertTransformValue(property: TransformationType, rawValue: string): TransformationValue { |
| 115 | const values = rawValue.split(',').map(parseFloat); |
no test coverage detected