(raw_value: Any)
| 100 | |
| 101 | |
| 102 | def parse_authors(raw_value: Any) -> List[str]: |
| 103 | if raw_value in (None, "", []): |
| 104 | return [] |
| 105 | if isinstance(raw_value, list): |
| 106 | return [str(item).strip() for item in raw_value if str(item).strip()] |
| 107 | if isinstance(raw_value, str): |
| 108 | try: |
| 109 | parsed = json.loads(raw_value) |
| 110 | except json.JSONDecodeError: |
| 111 | parsed = None |
| 112 | if isinstance(parsed, list): |
| 113 | return [str(item).strip() for item in parsed if str(item).strip()] |
| 114 | if parsed is not None: |
| 115 | return [str(parsed).strip()] |
| 116 | return [item.strip() for item in raw_value.split(",") if item.strip()] |
| 117 | return [str(raw_value).strip()] if str(raw_value).strip() else [] |
| 118 | |
| 119 | |
| 120 | def parse_string_list(raw_value: Any) -> List[str]: |
no outgoing calls
no test coverage detected