Skip to content

Commit

Permalink
fix: Somehow didn't save a file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit0 committed Dec 26, 2020
1 parent 0d53915 commit 33c2bc6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 6 additions & 1 deletion src/lib/converter/factories/signature.ts
Expand Up @@ -33,7 +33,12 @@ export function createSignature(
| ts.SignatureDeclaration
| undefined;

if (!commentDeclaration && declaration && (ts.isArrowFunction(declaration) || ts.isFunctionExpression(declaration)) {
if (
!commentDeclaration &&
declaration &&
(ts.isArrowFunction(declaration) ||
ts.isFunctionExpression(declaration))
) {
commentDeclaration = declaration.parent;
}
commentDeclaration ??= declaration;
Expand Down
4 changes: 2 additions & 2 deletions src/test/converter/function/specs.json
Expand Up @@ -294,7 +294,7 @@
"flags": {},
"comment": {
"shortText": "Returns true if fn returns true for every item in the iterator",
"text": "Returns true if the iterator is empty\n\n## Example\n```typescript\nall(e => e > 1, [1, 2, 3]) // false\nall(e => e > 0, [1, 2, 3]) // true\nall(e => e > 1, []) // true\n```\n"
"text": "Returns true if the iterator is empty\n"
},
"typeParameter": [
{
Expand Down Expand Up @@ -380,7 +380,7 @@
"flags": {},
"comment": {
"shortText": "Returns true if fn returns true for every item in the iterator",
"text": "Returns true if the iterator is empty\n\n## Example\n```typescript\nall(e => e > 1, [1, 2, 3]) // false\nall(e => e > 0, [1, 2, 3]) // true\nall(e => e > 1, []) // true\n```\n"
"text": "Returns true if the iterator is empty\n"
},
"typeParameter": [
{
Expand Down

0 comments on commit 33c2bc6

Please sign in to comment.