File tree Expand file tree Collapse file tree 3 files changed +10
-4
lines changed
Expand file tree Collapse file tree 3 files changed +10
-4
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ " @heymp/scratchpad " : patch
3+ ---
4+
5+ Fix: simplify readFile arguments
Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ function nodelog(value: any) {
1111}
1212
1313function writeFile ( path : string , data : any ) {
14- return fs . writeFile ( join ( process . cwd ( ) , path ) , data ) ;
14+ return fs . writeFile ( path , data ) ;
1515}
1616
1717function appendFile ( path : string , data : any ) {
18- return fs . appendFile ( join ( process . cwd ( ) , path ) , data ) ;
18+ return fs . appendFile ( path , data ) ;
1919}
2020
21- function readFile ( ... args : Parameters < typeof fs . readFile > ) {
22- return fs . readFile ( ... args ) ;
21+ function readFile ( path : string ) {
22+ return fs . readFile ( path , 'utf8' ) ;
2323}
2424
2525export async function browser ( processor : Processor ) {
Original file line number Diff line number Diff line change 11declare function log ( ...args : any [ ] ) : void ;
22declare function clear ( ) : void ;
33declare function writeFile ( string , any ) : Promise < void > ;
4+ declare function readFile ( string ) : Promise < string > ;
45declare function appendFile ( string , any ) : Promise < void > ;
You can’t perform that action at this time.
0 commit comments