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 18, 2023
1 parent 6b1597a commit 073ec6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/fsa-to-node/FsaNodeFs.ts
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 073ec6b

Please sign in to comment.