Skip to content

Commit

Permalink
Lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Benoit-Welsch committed Apr 30, 2024
1 parent 446e416 commit 86045c4
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/Scanner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,23 @@ export class File {

watch(callback: (file: File) => void, options: WatchOptions = {}) {
//use fs.watch
watch(this.fqn(), { ...options, recursive: false }, (event, fileName: any | Error) => {
if (fileName instanceof Error) {
throw fileName;
}

if (event === 'rename' || event === 'change') {
this.name = fileName || this.name;
}
if (event === 'change') {
this.meta = statSync(this.fqn());
}
callback(this);
});
watch(
this.fqn(),
{ ...options, recursive: false },
(event, fileName: any | Error) => {
if (fileName instanceof Error) {
throw fileName;
}

if (event === 'rename' || event === 'change') {
this.name = fileName || this.name;
}
if (event === 'change') {
this.meta = statSync(this.fqn());
}
callback(this);
},
);
}
}

Expand Down

0 comments on commit 86045c4

Please sign in to comment.