mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Switch frontend to use json helper (#73874)
This commit is contained in:
@ -87,6 +87,15 @@ def json_dumps(data: Any) -> str:
|
||||
).decode("utf-8")
|
||||
|
||||
|
||||
def json_dumps_sorted(data: Any) -> str:
|
||||
"""Dump json string with keys sorted."""
|
||||
return orjson.dumps(
|
||||
data,
|
||||
option=orjson.OPT_NON_STR_KEYS | orjson.OPT_SORT_KEYS,
|
||||
default=json_encoder_default,
|
||||
).decode("utf-8")
|
||||
|
||||
|
||||
json_loads = orjson.loads
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user