Skip to content

Commit

Permalink
Merge pull request #8 from ktsn/update-typescript
Browse files Browse the repository at this point in the history
Make compatible with latest TypeScript
  • Loading branch information
ktsn authored Apr 29, 2017
2 parents 53be300 + 276777f commit 6e5c303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"colors": "^1.1.2",
"commander": "^2.9.0",
"glob": "^7.1.1",
"typescript": "^2.1.5",
"typescript": "~2.3.2",
"vue-template-compiler": "^2.1.8"
}
}
10 changes: 5 additions & 5 deletions src/lib/ts-file-map.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ export interface TsFile {
}

export class TsFileMap {
private files = {} as ts.Map<TsFile>
private files = new Map<string, TsFile>()

get fileNames (): string[] {
return Object.keys(this.files).filter(file => isSupportedFile(file))
return Array.from(this.files.keys()).filter(file => isSupportedFile(file))
}

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ export class TsFileMap {
* - Loaded but not found or unsupported
*/
private getFile (fileName: string): TsFile | undefined {
return this.files[fileName]
return this.files.get(fileName)
}

private registerFile (file: TsFile): void {
Expand All @@ -91,10 +91,10 @@ export class TsFileMap {
if (isVueFile(rawFileName)) {
// To ensure the compiler can process .vue file,
// we need to add .ts suffix to file name
this.files[rawFileName + '.ts'] = file
this.files.set(rawFileName + '.ts', file)
}

this.files[rawFileName] = file
this.files.set(rawFileName, file)
}
}

Expand Down

0 comments on commit 6e5c303

Please sign in to comment.