File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 3030 "url" : " https://github.com/TypeScript-Heroes/node-typescript-parser/issues"
3131 },
3232 "homepage" : " https://github.com/TypeScript-Heroes/node-typescript-parser#readme" ,
33- "release" : {
34- "generateNotes" : " github-post-release"
35- },
3633 "devDependencies" : {
3734 "@types/jest" : " ^20.0.1" ,
3835 "@types/mock-fs" : " ^3.6.30" ,
3936 "@types/node" : " ^8.0.1" ,
4037 "del-cli" : " ^1.0.0" ,
41- "github-post-release" : " ^1.7.1" ,
4238 "jest" : " ^20.0.4" ,
4339 "mock-fs" : " ^4.4.1" ,
4440 "semantic-release" : " ^6.3.6" ,
Original file line number Diff line number Diff line change @@ -30,9 +30,15 @@ import { TypescriptGenerationOptions } from './TypescriptGenerationOptions';
3030 */
3131export type Generatable = Declaration | Import | Export | SymbolSpecifier ;
3232
33- type Generators = { [ name : string ] : ( generatable : Generatable , options : TypescriptGenerationOptions ) => string } ;
33+ /**
34+ * Type for generators.
35+ */
36+ export type Generators = { [ name : string ] : ( generatable : Generatable , options : TypescriptGenerationOptions ) => string } ;
3437
35- const generators : Generators = {
38+ /**
39+ * Hash with all possible (yet implemented) generators.
40+ */
41+ export const GENERATORS : Generators = {
3642 [ SymbolSpecifier . name ] : generateSymbolSpecifier ,
3743 [ MethodDeclaration . name ] : generateMethodDeclaration ,
3844 [ ParameterDeclaration . name ] : generateParameterDeclaration ,
@@ -63,8 +69,8 @@ export class TypescriptCodeGenerator {
6369 * @memberof TypescriptCodeGenerator
6470 */
6571 public generate ( declaration : Generatable ) : string {
66- if ( generators [ declaration . constructor . name ] ) {
67- return generators [ declaration . constructor . name ] ( declaration , this . options ) ;
72+ if ( GENERATORS [ declaration . constructor . name ] ) {
73+ return GENERATORS [ declaration . constructor . name ] ( declaration , this . options ) ;
6874 }
6975 throw new NotGeneratableYetError ( declaration ) ;
7076 }
You can’t perform that action at this time.
0 commit comments