(children: list[VdomChild])
| 724 | |
| 725 | |
| 726 | def _get_children_info(children: list[VdomChild]) -> Sequence[_ChildInfo]: |
| 727 | infos: list[_ChildInfo] = [] |
| 728 | for index, child in enumerate(children): |
| 729 | if child is None: |
| 730 | continue |
| 731 | elif isinstance(child, dict): |
| 732 | child_type = _DICT_TYPE |
| 733 | key = child.get("key") |
| 734 | elif isinstance(child, ComponentType): |
| 735 | child_type = _COMPONENT_TYPE |
| 736 | key = child.key |
| 737 | else: |
| 738 | child = f"{child}" |
| 739 | child_type = _STRING_TYPE |
| 740 | key = None |
| 741 | |
| 742 | if key is None: |
| 743 | key = index |
| 744 | |
| 745 | infos.append((child, child_type, key)) |
| 746 | |
| 747 | return infos |
| 748 | |
| 749 | |
| 750 | _ChildInfo: TypeAlias = tuple[Any, "_ElementType", Key] |
no test coverage detected