@@ -63,16 +63,19 @@ const internalFs = {
6363 const name = filename . split ( "/" ) . pop ( ) ;
6464
6565 return new Promise ( ( resolve , reject ) => {
66- if ( udata === undefined || udata == null ) {
67- reject ( "udata is null" )
66+ if ( udata === undefined || udata == null ) {
67+ reject ( "udata is null" ) ;
6868 }
6969
70- let data
71- if ( udata instanceof ArrayBuffer || Object . prototype . toString . call ( udata ) === "[object ArrayBuffer]" ) {
72- const decoder = new TextDecoder ( 'utf-8' ) ;
70+ let data ;
71+ if (
72+ udata instanceof ArrayBuffer ||
73+ Object . prototype . toString . call ( udata ) === "[object ArrayBuffer]"
74+ ) {
75+ const decoder = new TextDecoder ( "utf-8" ) ;
7376 data = decoder . decode ( udata ) ;
74- } else {
75- data = udata
77+ } else {
78+ data = udata ;
7679 }
7780
7881 reject = setMessage ( reject ) ;
@@ -105,11 +108,10 @@ const internalFs = {
105108 */
106109
107110 delete ( filename ) {
108- console . log ( "deletion skipped" )
109- return
111+ console . log ( "deletion skipped" ) ;
112+ return ;
110113 return new Promise ( ( resolve , reject ) => {
111114 console . log ( "Deleting " + filename ) ;
112-
113115
114116 Filesystem . stat ( { path : filename } )
115117 . then ( ( stats ) => {
@@ -143,8 +145,8 @@ const internalFs = {
143145 . then ( ( readFileResult ) => {
144146 const encoder = new TextEncoder ( ) ;
145147 const buffer = encoder . encode ( readFileResult . data ) . buffer ;
146-
147- resolve ( { data : buffer } )
148+
149+ resolve ( { data : buffer } ) ;
148150 } )
149151 . catch ( ( error ) => {
150152 console . error (
@@ -161,7 +163,7 @@ const internalFs = {
161163 reject = setMessage ( reject ) ;
162164 Filesystem . readFile ( { path : filename , encoding : Encoding . UTF8 } )
163165 . then ( ( readFileResult ) => {
164- resolve ( { data : readFileResult . data } )
166+ resolve ( { data : readFileResult . data } ) ;
165167 } )
166168 . catch ( ( error ) => {
167169 console . error (
@@ -173,7 +175,6 @@ const internalFs = {
173175 } ) ;
174176 } ,
175177
176-
177178 /**
178179 * Rename a file or directory
179180 * @param {string } url
@@ -218,9 +219,7 @@ const internalFs = {
218219 recursive : true ,
219220 } )
220221 . then ( ( ) => {
221- console . log (
222- `Created ${ path } /${ dirname } ` ,
223- ) ;
222+ console . log ( `Created ${ path } /${ dirname } ` ) ;
224223 Filesystem . stat ( { path : `${ path } /${ dirname } ` } )
225224 . then ( ( stats ) => resolve ( stats . url ) )
226225 . catch ( reject ) ;
@@ -507,7 +506,7 @@ function createFs(url) {
507506 return files ;
508507 } ,
509508 async readFile ( encoding ) {
510- console . log ( "fs read " + url )
509+ console . log ( "fs read " + url ) ;
511510 let { data } = await internalFs . readFile ( url , encoding ) ;
512511
513512 if ( encoding ) {
0 commit comments