( ctx: ComponentPublicInstance, path: string, )
| 268 | } |
| 269 | |
| 270 | export function createPathGetter( |
| 271 | ctx: ComponentPublicInstance, |
| 272 | path: string, |
| 273 | ): () => WatchSource | WatchSource[] | WatchEffect | object { |
| 274 | const segments = path.split('.') |
| 275 | return (): WatchSource | WatchSource[] | WatchEffect | object => { |
| 276 | let cur = ctx |
| 277 | for (let i = 0; i < segments.length && cur; i++) { |
| 278 | cur = cur[segments[i] as keyof typeof cur] |
| 279 | } |
| 280 | return cur |
| 281 | } |
| 282 | } |
no outgoing calls
no test coverage detected