Skip to content

Commit

Permalink
HTML search: typing/lint fixups for ruff and mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
jayaddison committed Nov 16, 2024
1 parent 381c26f commit ac281dc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion sphinx/search/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ class _JavaScriptIndex:
SUFFIX = ')'

def dumps(self, data: Any) -> str:
json_dump = lambda data: json.dumps(data, separators=(',', ':'))
def json_dump(data: str | tuple | list) -> str:
return json.dumps(data, separators=(',', ':'))

js_indices = {
json_dump(name): f'new Map({json_dump(sorted(entries.items()))})'
if isinstance(entries, dict)
Expand Down

0 comments on commit ac281dc

Please sign in to comment.