bare-fs 4.4.0 → 4.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -16
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1470,10 +1470,7 @@ async function readFile(filepath, opts, cb) {
|
|
|
1470
1470
|
} catch (err) {
|
|
1471
1471
|
fail(err, cb)
|
|
1472
1472
|
} finally {
|
|
1473
|
-
if (fd
|
|
1474
|
-
try {
|
|
1475
|
-
await close(fd)
|
|
1476
|
-
} catch {}
|
|
1473
|
+
if (fd !== -1) await close(fd)
|
|
1477
1474
|
}
|
|
1478
1475
|
}
|
|
1479
1476
|
|
|
@@ -1520,10 +1517,7 @@ function readFileSync(filepath, opts) {
|
|
|
1520
1517
|
|
|
1521
1518
|
return buffer
|
|
1522
1519
|
} finally {
|
|
1523
|
-
if (fd
|
|
1524
|
-
try {
|
|
1525
|
-
closeSync(fd)
|
|
1526
|
-
} catch {}
|
|
1520
|
+
if (fd !== -1) closeSync(fd)
|
|
1527
1521
|
}
|
|
1528
1522
|
}
|
|
1529
1523
|
|
|
@@ -1553,10 +1547,7 @@ async function writeFile(filepath, data, opts, cb) {
|
|
|
1553
1547
|
} catch (err) {
|
|
1554
1548
|
fail(err, cb)
|
|
1555
1549
|
} finally {
|
|
1556
|
-
if (fd
|
|
1557
|
-
try {
|
|
1558
|
-
await close(fd)
|
|
1559
|
-
} catch {}
|
|
1550
|
+
if (fd !== -1) await close(fd)
|
|
1560
1551
|
}
|
|
1561
1552
|
}
|
|
1562
1553
|
|
|
@@ -1577,10 +1568,7 @@ function writeFileSync(filepath, data, opts) {
|
|
|
1577
1568
|
if (len === data.byteLength) break
|
|
1578
1569
|
}
|
|
1579
1570
|
} finally {
|
|
1580
|
-
if (fd
|
|
1581
|
-
try {
|
|
1582
|
-
closeSync(fd)
|
|
1583
|
-
} catch {}
|
|
1571
|
+
if (fd !== -1) closeSync(fd)
|
|
1584
1572
|
}
|
|
1585
1573
|
}
|
|
1586
1574
|
|