dify/api/libs/orjson.py
-LAN- bab4975809
chore: add ast-grep rule to convert Optional[T] to T | None (#25560)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-09-15 13:06:33 +08:00

12 lines
203 B
Python

from typing import Any
import orjson
def orjson_dumps(
obj: Any,
encoding: str = "utf-8",
option: int | None = None,
) -> str:
return orjson.dumps(obj, option=option).decode(encoding)