(rule)
| 135 | } |
| 136 | |
| 137 | export function toProps(rule) { |
| 138 | const prop = {...(rule.props || {})}; |
| 139 | |
| 140 | Object.keys(rule.on || {}).forEach(k => { |
| 141 | if (k.indexOf('-') > 0) { |
| 142 | k = toCase(k); |
| 143 | } |
| 144 | const name = `on${upper(k)}`; |
| 145 | if (Array.isArray(prop[name])) { |
| 146 | prop[name] = [...prop[name], rule.on[k]]; |
| 147 | } else if (prop[name]) { |
| 148 | prop[name] = [prop[name], rule.on[k]]; |
| 149 | } else { |
| 150 | prop[name] = rule.on[k]; |
| 151 | } |
| 152 | }) |
| 153 | prop.key = rule.key; |
| 154 | prop.ref = rule.ref; |
| 155 | prop.class = rule.class; |
| 156 | prop.id = rule.id; |
| 157 | prop.style = rule.style; |
| 158 | if (prop.slot) delete prop.slot; |
| 159 | |
| 160 | return prop; |
| 161 | } |
| 162 | |
| 163 | export function setPrototypeOf(o, proto) { |
| 164 | Object.setPrototypeOf(o, proto); |
no test coverage detected