Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: check for null variable when excludeNotExported is true (#694)
- Loading branch information
1 parent
3581d04
commit fa6d9fe
Showing
5 changed files
with
391 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const x = 5; | ||
|
||
export function add(x: number, y: number) { | ||
return x + y; | ||
} | ||
|
||
// Add a local var/function to make sure typedoc won't choke | ||
// if excludeNotExported is true | ||
let localVar = 'local'; | ||
|
||
function times(x: number, y: number) { | ||
return x * y; | ||
} |
127 changes: 127 additions & 0 deletions
127
src/test/converter/export-with-local/specs-without-exported.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
{ | ||
"id": 0, | ||
"name": "typedoc", | ||
"kind": 0, | ||
"flags": {}, | ||
"children": [ | ||
{ | ||
"id": 1, | ||
"name": "\"export-with-local\"", | ||
"kind": 1, | ||
"kindString": "External module", | ||
"flags": { | ||
"isExported": true | ||
}, | ||
"originalName": "%BASE%/export-with-local/export-with-local.ts", | ||
"children": [ | ||
{ | ||
"id": 2, | ||
"name": "x", | ||
"kind": 32, | ||
"kindString": "Variable", | ||
"flags": { | ||
"isExported": true, | ||
"isConst": true | ||
}, | ||
"sources": [ | ||
{ | ||
"fileName": "export-with-local.ts", | ||
"line": 1, | ||
"character": 14 | ||
} | ||
], | ||
"type": { | ||
"type": "unknown", | ||
"name": "5" | ||
}, | ||
"defaultValue": "5" | ||
}, | ||
{ | ||
"id": 3, | ||
"name": "add", | ||
"kind": 64, | ||
"kindString": "Function", | ||
"flags": { | ||
"isExported": true | ||
}, | ||
"signatures": [ | ||
{ | ||
"id": 4, | ||
"name": "add", | ||
"kind": 4096, | ||
"kindString": "Call signature", | ||
"flags": {}, | ||
"parameters": [ | ||
{ | ||
"id": 5, | ||
"name": "x", | ||
"kind": 32768, | ||
"kindString": "Parameter", | ||
"flags": {}, | ||
"type": { | ||
"type": "intrinsic", | ||
"name": "number" | ||
} | ||
}, | ||
{ | ||
"id": 6, | ||
"name": "y", | ||
"kind": 32768, | ||
"kindString": "Parameter", | ||
"flags": {}, | ||
"type": { | ||
"type": "intrinsic", | ||
"name": "number" | ||
} | ||
} | ||
], | ||
"type": { | ||
"type": "intrinsic", | ||
"name": "number" | ||
} | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "export-with-local.ts", | ||
"line": 3, | ||
"character": 19 | ||
} | ||
] | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "Variables", | ||
"kind": 32, | ||
"children": [ | ||
2 | ||
] | ||
}, | ||
{ | ||
"title": "Functions", | ||
"kind": 64, | ||
"children": [ | ||
3 | ||
] | ||
} | ||
], | ||
"sources": [ | ||
{ | ||
"fileName": "export-with-local.ts", | ||
"line": 1, | ||
"character": 0 | ||
} | ||
] | ||
} | ||
], | ||
"groups": [ | ||
{ | ||
"title": "External modules", | ||
"kind": 1, | ||
"children": [ | ||
1 | ||
] | ||
} | ||
] | ||
} |
Oops, something went wrong.