Skip to content

Commit

Permalink
Replace colon with arrow in function types
Browse files Browse the repository at this point in the history
  • Loading branch information
hoodmane committed Sep 24, 2023
1 parent c976889 commit 9313d81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion sphinx_js/typedoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ def inner(param: Param) -> Iterator[str | ir.TypeXRef]:

yield from riffle((inner(param) for param in self.parameters), ", ")

yield "): "
yield ") => "
return_type = self.return_type(converter)
if return_type:
ret = return_type[0].type
Expand Down
6 changes: 3 additions & 3 deletions tests/test_typedoc_analysis/test_typedoc_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -560,9 +560,9 @@ def test_constrained_by_constructor(self):
"""Make sure ``new ()`` expressions and, more generally, per-property
constraints are rendered properly."""
obj = self.analyzer.get_object(["create1"])
assert join_type(obj.params[0].type) == "{new (x: number): A}"
assert join_type(obj.params[0].type) == "{new (x: number) => A}"
obj = self.analyzer.get_object(["create2"])
assert join_type(obj.params[0].type) == "{new (): T}"
assert join_type(obj.params[0].type) == "{new () => T}"

def test_utility_types(self):
"""Test that a representative one of TS's utility types renders."""
Expand Down Expand Up @@ -619,4 +619,4 @@ def test_destructured(self):
def test_funcarg(self):
obj = self.analyzer.get_object(["funcArg"])
assert obj.params[0].name == "a"
assert join_type(obj.params[0].type) == "(b: number, c: number): number"
assert join_type(obj.params[0].type) == "(b: number, c: number) => number"

0 comments on commit 9313d81

Please sign in to comment.