( instance: ComponentInternalInstance, )
| 1187 | } |
| 1188 | |
| 1189 | export function getComponentPublicInstance( |
| 1190 | instance: ComponentInternalInstance, |
| 1191 | ): ComponentPublicInstance | ComponentInternalInstance['exposed'] | null { |
| 1192 | if (instance.exposed) { |
| 1193 | return ( |
| 1194 | instance.exposeProxy || |
| 1195 | (instance.exposeProxy = new Proxy(proxyRefs(markRaw(instance.exposed)), { |
| 1196 | get(target, key: string) { |
| 1197 | if (key in target) { |
| 1198 | return target[key] |
| 1199 | } else if (key in publicPropertiesMap) { |
| 1200 | return publicPropertiesMap[key](instance) |
| 1201 | } |
| 1202 | }, |
| 1203 | has(target, key: string) { |
| 1204 | return key in target || key in publicPropertiesMap |
| 1205 | }, |
| 1206 | })) |
| 1207 | ) |
| 1208 | } else { |
| 1209 | return instance.proxy |
| 1210 | } |
| 1211 | } |
| 1212 | |
| 1213 | const classifyRE = /(?:^|[-_])\w/g |
| 1214 | const classify = (str: string): string => |
no test coverage detected