@@ -28,21 +28,16 @@ const imports = {
2828} ;
2929let outputFiles = { } ;
3030
31- function addType ( filePath , template , options ) {
31+ function addType ( tsVersion , subset , template , options ) {
32+ const filePath = buildFilePath ( tsVersion , subset ) ;
33+ if ( ! outputFiles [ filePath ] ) outputFiles [ filePath ] = '' ;
3234 const entryWithTypes = template ( options ) ;
3335 outputFiles [ filePath ] += `${ entryWithTypes . types } ${ entryWithTypes . types ? '\n' : '' } ` ;
3436}
3537
3638function addEntryTypes ( tsVersion , template , options ) {
37- const indexPath = buildFilePath ( tsVersion , 'index' ) ;
38- if ( ! outputFiles [ indexPath ] ) outputFiles [ indexPath ] = '' ;
39- const optionsGlobal = { ...options , packageName : PACKAGE_NAME } ;
40- addType ( indexPath , template , optionsGlobal ) ;
41-
42- const purePath = buildFilePath ( tsVersion , 'pure' ) ;
43- if ( ! outputFiles [ purePath ] ) outputFiles [ purePath ] = '' ;
44- const optionsPure = { ...options , packageName : PACKAGE_NAME_PURE , prefix : TYPE_PREFIX } ;
45- addType ( purePath , template , optionsPure ) ;
39+ addType ( tsVersion , 'index' , template , { ...options , packageName : PACKAGE_NAME } ) ;
40+ addType ( tsVersion , 'pure' , template , { ...options , packageName : PACKAGE_NAME_PURE , prefix : TYPE_PREFIX } ) ;
4641}
4742
4843async function buildType ( entry , options ) {
0 commit comments