Encode a plain string as a BiDi BytesValue dict; pass dicts through.
(value: Any)
| 95 | |
| 96 | |
| 97 | def _encode_bytes_value(value: Any) -> Any: |
| 98 | """Encode a plain string as a BiDi BytesValue dict; pass dicts through.""" |
| 99 | if isinstance(value, str): |
| 100 | return {"type": "string", "value": value} |
| 101 | if hasattr(value, "to_bidi_dict"): |
| 102 | return value.to_bidi_dict() |
| 103 | return value |
| 104 | |
| 105 | |
| 106 | def headers_to_dict(headers: list | None) -> dict[str, str]: |
no test coverage detected