File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 30
30
"url" : " https://github.com/TypeScript-Heroes/node-typescript-parser/issues"
31
31
},
32
32
"homepage" : " https://github.com/TypeScript-Heroes/node-typescript-parser#readme" ,
33
- "release" : {
34
- "generateNotes" : " github-post-release"
35
- },
36
33
"devDependencies" : {
37
34
"@types/jest" : " ^20.0.1" ,
38
35
"@types/mock-fs" : " ^3.6.30" ,
39
36
"@types/node" : " ^8.0.1" ,
40
37
"del-cli" : " ^1.0.0" ,
41
- "github-post-release" : " ^1.7.1" ,
42
38
"jest" : " ^20.0.4" ,
43
39
"mock-fs" : " ^4.4.1" ,
44
40
"semantic-release" : " ^6.3.6" ,
Original file line number Diff line number Diff line change @@ -30,9 +30,15 @@ import { TypescriptGenerationOptions } from './TypescriptGenerationOptions';
30
30
*/
31
31
export type Generatable = Declaration | Import | Export | SymbolSpecifier ;
32
32
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 } ;
34
37
35
- const generators : Generators = {
38
+ /**
39
+ * Hash with all possible (yet implemented) generators.
40
+ */
41
+ export const GENERATORS : Generators = {
36
42
[ SymbolSpecifier . name ] : generateSymbolSpecifier ,
37
43
[ MethodDeclaration . name ] : generateMethodDeclaration ,
38
44
[ ParameterDeclaration . name ] : generateParameterDeclaration ,
@@ -63,8 +69,8 @@ export class TypescriptCodeGenerator {
63
69
* @memberof TypescriptCodeGenerator
64
70
*/
65
71
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 ) ;
68
74
}
69
75
throw new NotGeneratableYetError ( declaration ) ;
70
76
}
You can’t perform that action at this time.
0 commit comments