Skip to content

Commit 0665271

Browse files
committed
chore: exclude fsyncDir from coverage instead of just its branches
1 parent bf69947 commit 0665271

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib/db.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,15 @@ export interface FsWriteOptions {
8484
/**
8585
* fsync on a directory ensures there are no rename operations etc. which haven't been persisted to disk.
8686
*/
87+
/* istanbul ignore next - This is impossible to test */
8788
async function fsyncDir(dirname: string): Promise<void> {
8889
// Windows will cause `EPERM: operation not permitted, fsync`
8990
// for directories, so don't do this
9091

91-
/* istanbul ignore else */
9292
if (process.platform === "win32") return;
93-
else {
94-
const fd = await fs.open(dirname, "r");
95-
await fs.fsync(fd);
96-
await fs.close(fd);
97-
}
93+
const fd = await fs.open(dirname, "r");
94+
await fs.fsync(fd);
95+
await fs.close(fd);
9896
}
9997

10098
export class JsonlDB<V extends unknown = unknown> {

0 commit comments

Comments
 (0)