@@ -95,7 +95,7 @@ export function titleCase(str: string) {
95
95
}
96
96
97
97
98
- export function writeFileAsync ( filePath : string , content : string ) : Promise < any > {
98
+ export function writeFileAsync ( filePath : string , content : string ) {
99
99
return new Promise ( ( resolve , reject ) => {
100
100
writeFile ( filePath , content , ( err ) => {
101
101
if ( err ) {
@@ -106,8 +106,8 @@ export function writeFileAsync(filePath: string, content: string): Promise<any>
106
106
} ) ;
107
107
}
108
108
109
- export function readFileAsync ( filePath : string ) : Promise < string > {
110
- return new Promise ( ( resolve , reject ) => {
109
+ export function readFileAsync ( filePath : string ) {
110
+ return new Promise < string > ( ( resolve , reject ) => {
111
111
readFile ( filePath , 'utf-8' , ( err , buffer ) => {
112
112
if ( err ) {
113
113
return reject ( err ) ;
@@ -128,7 +128,7 @@ export function readAndCacheFile(filePath: string, purge: boolean = false): Prom
128
128
} ) ;
129
129
}
130
130
131
- export function unlinkAsync ( filePath : string | string [ ] ) : Promise < any > {
131
+ export function unlinkAsync ( filePath : string | string [ ] ) {
132
132
let filePaths : string [ ] ;
133
133
134
134
if ( typeof filePath === 'string' ) {
@@ -140,7 +140,7 @@ export function unlinkAsync(filePath: string|string[]): Promise<any> {
140
140
}
141
141
142
142
let promises = filePaths . map ( filePath => {
143
- return new Promise ( ( resolve , reject ) => {
143
+ return new Promise < void > ( ( resolve , reject ) => {
144
144
unlink ( filePath , ( err : Error ) => {
145
145
if ( err ) {
146
146
return reject ( err ) ;
@@ -153,8 +153,8 @@ export function unlinkAsync(filePath: string|string[]): Promise<any> {
153
153
return Promise . all ( promises ) ;
154
154
}
155
155
156
- export function rimRafAsync ( directoryPath : string ) : Promise < null > {
157
- return new Promise ( ( resolve , reject ) => {
156
+ export function rimRafAsync ( directoryPath : string ) {
157
+ return new Promise < void > ( ( resolve , reject ) => {
158
158
remove ( directoryPath , ( err : Error ) => {
159
159
if ( err ) {
160
160
return reject ( err ) ;
@@ -164,8 +164,8 @@ export function rimRafAsync(directoryPath: string): Promise<null> {
164
164
} ) ;
165
165
}
166
166
167
- export function copyFileAsync ( srcPath : string , destPath : string ) : Promise < any > {
168
- return new Promise ( ( resolve , reject ) => {
167
+ export function copyFileAsync ( srcPath : string , destPath : string ) {
168
+ return new Promise < void > ( ( resolve , reject ) => {
169
169
const writeStream = createWriteStream ( destPath ) ;
170
170
171
171
writeStream . on ( 'error' , ( err : Error ) => {
@@ -180,8 +180,8 @@ export function copyFileAsync(srcPath: string, destPath: string): Promise<any> {
180
180
} ) ;
181
181
}
182
182
183
- export function readDirAsync ( pathToDir : string ) : Promise < string [ ] > {
184
- return new Promise ( ( resolve , reject ) => {
183
+ export function readDirAsync ( pathToDir : string ) {
184
+ return new Promise < string [ ] > ( ( resolve , reject ) => {
185
185
readdir ( pathToDir , ( err : Error , fileNames : string [ ] ) => {
186
186
if ( err ) {
187
187
return reject ( err ) ;
0 commit comments