Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update typescript #1014

Merged
merged 3 commits into from
Apr 28, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"progress": "^2.0.3",
"shelljs": "^0.8.3",
"typedoc-default-themes": "^0.6.0-0",
"typescript": "3.3.x"
"typescript": "3.4.x"
},
"devDependencies": {
"@types/mocha": "^5.2.6",
Expand Down
5 changes: 4 additions & 1 deletion src/lib/converter/plugins/SourcePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,14 @@ export class SourcePlugin extends ConverterComponent {
if (!reflection.sources) {
reflection.sources = [];
}

const sources = reflection.sources;

if (reflection instanceof DeclarationReflection) {
file.reflections.push(reflection);
}

reflection.sources.push({
sources.push({
Copy link
Contributor Author

@just-boris just-boris Apr 16, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This change is needed, because file.reflections.push(reflection) can potentially mutate sources key. Without this change there is an "object can be possibly undefined" error.

I guess, typescript 3.4 became smarter and requires us to have an explicit stored reference to the array.

file: file,
fileName: fileName,
line: position.line + 1,
Expand Down