(value: Any)
| 46 | |
| 47 | |
| 48 | def _normalize_list(value: Any) -> List[str]: |
| 49 | if value is None: |
| 50 | return [] |
| 51 | if isinstance(value, str): |
| 52 | text = value.strip() |
| 53 | if not text: |
| 54 | return [] |
| 55 | if text.startswith("["): |
| 56 | try: |
| 57 | parsed = json.loads(text) |
| 58 | except json.JSONDecodeError: |
| 59 | parsed = None |
| 60 | if isinstance(parsed, list): |
| 61 | return [str(item).strip() for item in parsed if str(item).strip()] |
| 62 | return [text] |
| 63 | if isinstance(value, dict): |
| 64 | return [str(item).strip() for item in value.values() if str(item).strip()] |
| 65 | if isinstance(value, Iterable): |
| 66 | return [str(item).strip() for item in value if str(item).strip()] |
| 67 | text = str(value).strip() |
| 68 | return [text] if text else [] |
| 69 | |
| 70 | |
| 71 | def _body_text(value: Any) -> str: |
no outgoing calls
no test coverage detected