Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"dependencies": {
"lodash": "^4.17.4",
"tslib": "^1.7.1",
"typescript": "2.4.2"
"typescript": "^2.5.3"
Copy link
Owner

Choose a reason for hiding this comment

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

Question: so they did fix the problem with the typed declaration in #24 ?

}
}
2 changes: 1 addition & 1 deletion src/DeclarationIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ export class DeclarationIndex {
*/
public get declarationInfos(): DeclarationInfo[] {
return Object
.keys(this.index)
.keys(this.index!)
.sort()
.reduce((all, key) => all.concat(this.index![key]), <DeclarationInfo[]>[]);
}
Expand Down
2 changes: 1 addition & 1 deletion test/TypescriptParser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ describe('TypescriptParser', () => {
});

it('should parse imports', () => {
expect(parsed.imports).toHaveLength(9);
expect(parsed.imports).toHaveLength(12);
expect(parsed.imports).toMatchSnapshot();
});

Expand Down
30 changes: 30 additions & 0 deletions test/__snapshots__/TypescriptParser.spec.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1012,6 +1012,36 @@ Array [
],
"start": 400,
},
NamedImport {
"defaultAlias": "__DefaultAlias",
"end": 540,
"libraryName": "namedImport",
"specifiers": Array [
SymbolSpecifier {
"alias": "__Specifier1",
"specifier": "Specifier1",
},
],
"start": 456,
},
NamedImport {
"defaultAlias": "__DefaultAlias",
"end": 614,
"libraryName": "namedImport",
"specifiers": Array [
SymbolSpecifier {
"alias": "__Specifier1",
"specifier": "Specifier1",
},
],
"start": 541,
},
NamespaceImport {
"alias": "__namespaceImport",
"end": 662,
"libraryName": "namespace",
"start": 615,
},
]
`;

Expand Down
3 changes: 3 additions & 0 deletions test/_workspace/typescript-parser/importsOnly.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ import {
import Foobar from 'aFile';
import { default as DefaultAlias, Specifier1 } from 'namedImport';
import DefaultAlias, { Specifier1 } from 'namedImport';
import { default as __DefaultAlias, Specifier1 as __Specifier1 } from 'namedImport';
import __DefaultAlias, { Specifier1 as __Specifier1 } from 'namedImport';
import * as __namespaceImport from 'namespace';
Copy link
Owner

Choose a reason for hiding this comment

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

just a cosmetical thing: please enter a new line :-)