(instance: ComponentInternalInstance, type: string)
| 165 | } |
| 166 | |
| 167 | function extractKeys(instance: ComponentInternalInstance, type: string) { |
| 168 | const Comp = instance.type |
| 169 | if (isFunction(Comp)) { |
| 170 | return |
| 171 | } |
| 172 | const extracted: Record<string, any> = {} |
| 173 | for (const key in instance.ctx) { |
| 174 | if (isKeyOfType(Comp, key, type)) { |
| 175 | extracted[key] = instance.ctx[key] |
| 176 | } |
| 177 | } |
| 178 | return extracted |
| 179 | } |
| 180 | |
| 181 | function isKeyOfType(Comp: ComponentOptions, key: string, type: string) { |
| 182 | const opts = Comp[type] |
no test coverage detected