bare-fs 4.4.8 → 4.4.10

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.
Files changed (2) hide show
  1. package/index.js +8 -4
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -742,7 +742,9 @@ async function mkdir(filepath, opts, cb) {
742
742
  try {
743
743
  await mkdir(filepath, { mode })
744
744
  } catch (err) {
745
- if (err.code === 'ENOENT' || !(await stat(filepath)).isDirectory()) {
745
+ if (err.code !== 'ENOENT') {
746
+ if (!(await stat(filepath)).isDirectory()) throw err
747
+ } else {
746
748
  while (filepath.endsWith(path.sep)) filepath = filepath.slice(0, -1)
747
749
  const i = filepath.lastIndexOf(path.sep)
748
750
  if (i <= 0) throw err
@@ -793,7 +795,9 @@ function mkdirSync(filepath, opts) {
793
795
  try {
794
796
  mkdirSync(filepath, { mode })
795
797
  } catch (err) {
796
- if (err.code === 'ENOENT' || !statSync(filepath).isDirectory()) {
798
+ if (err.code !== 'ENOENT') {
799
+ if (!statSync(filepath).isDirectory()) throw err
800
+ } else {
797
801
  while (filepath.endsWith(path.sep)) filepath = filepath.slice(0, -1)
798
802
  const i = filepath.lastIndexOf(path.sep)
799
803
  if (i <= 0) throw err
@@ -1939,10 +1943,10 @@ class FileReadStream extends Readable {
1939
1943
 
1940
1944
  if (this._missing < len) len = this._missing
1941
1945
 
1942
- this.push(data.subarray(0, len))
1943
-
1944
1946
  this._missing -= len
1945
1947
  this._offset += len
1948
+
1949
+ this.push(data.subarray(0, len))
1946
1950
  }
1947
1951
 
1948
1952
  async _destroy(err, cb) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-fs",
3
- "version": "4.4.8",
3
+ "version": "4.4.10",
4
4
  "description": "Native file system operations for Javascript",
5
5
  "exports": {
6
6
  "./package": "./package.json",