(options = {})
| 55 | * Add unit to numeric values. |
| 56 | */ |
| 57 | export default function defaultUnit(options = {}) { |
| 58 | const camelCasedOptions = addCamelCasedVersion(options) |
| 59 | |
| 60 | function onProcessStyle(style, rule) { |
| 61 | if (rule.type !== 'style') return style |
| 62 | |
| 63 | for (const prop in style) { |
| 64 | style[prop] = iterate(prop, style[prop], camelCasedOptions) |
| 65 | } |
| 66 | |
| 67 | return style |
| 68 | } |
| 69 | |
| 70 | function onChangeValue(value, prop) { |
| 71 | return iterate(prop, value, camelCasedOptions) |
| 72 | } |
| 73 | |
| 74 | return {onProcessStyle, onChangeValue} |
| 75 | } |
no test coverage detected
searching dependent graphs…