| 14 | } |
| 15 | |
| 16 | export function widgetPathEntry(vnode: VNode): string { |
| 17 | const props = vnode.props as { id?: unknown; key?: unknown } | undefined; |
| 18 | const id = typeof props?.id === "string" && props.id.length > 0 ? `#${props.id}` : ""; |
| 19 | const key = |
| 20 | typeof props?.key === "string" || typeof props?.key === "number" |
| 21 | ? `[key=${String(props.key)}]` |
| 22 | : ""; |
| 23 | return `${vnode.kind}${id}${key}`; |
| 24 | } |
| 25 | |
| 26 | export function formatWidgetPath(depth: number, tailPath: readonly string[]): string { |
| 27 | if (tailPath.length === 0) return "(root)"; |