Skip to content

Commit

Permalink
feat: 🎸 add existsSync() method
Browse files Browse the repository at this point in the history
  • Loading branch information
streamich committed Jun 20, 2023
1 parent f13ddb7 commit 0492a98
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fsa-to-node/FsaNodeFs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -823,9 +823,17 @@ export class FsaNodeFs extends FsaNodeCore implements FsCallbackApi, FsSynchrono
this.releasedFds.push(fd);
};

public readonly existsSync: FsSynchronousApi['existsSync'] = (path: misc.PathLike): boolean => {
try {
this.statSync(path);
return true;
} catch {
return false;
}
};

public readonly appendFileSync: FsSynchronousApi['appendFileSync'] = notSupported;
public readonly copyFileSync: FsSynchronousApi['copyFileSync'] = notSupported;
public readonly existsSync: FsSynchronousApi['existsSync'] = notSupported;
public readonly ftruncateSync: FsSynchronousApi['ftruncateSync'] = notSupported;
public readonly linkSync: FsSynchronousApi['linkSync'] = notSupported;
public readonly mkdirSync: FsSynchronousApi['mkdirSync'] = notSupported;
Expand Down

0 comments on commit 0492a98

Please sign in to comment.