bare-fs 4.8.7 → 4.8.8

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 CHANGED
@@ -1,4 +1,3 @@
1
- const FIFO = require('fast-fifo')
2
1
  const EventEmitter = require('bare-events')
3
2
  const path = require('bare-path')
4
3
  const { isURL, fileURLToPath } = require('bare-url')
@@ -6,6 +5,7 @@ const { Readable, Writable } = require('bare-stream')
6
5
  const binding = require('./binding')
7
6
  const constants = require('./lib/constants')
8
7
  const FileError = require('./lib/errors')
8
+ const Queue = require('./lib/queue')
9
9
 
10
10
  const isWindows = Bare.platform === 'win32'
11
11
 
@@ -2250,7 +2250,7 @@ class Dir {
2250
2250
 
2251
2251
  this._encoding = encoding
2252
2252
  this._capacity = bufferSize
2253
- this._buffer = new FIFO()
2253
+ this._buffer = new Queue()
2254
2254
  this._ended = false
2255
2255
  this._handle = handle
2256
2256
  }
package/lib/queue.js ADDED
@@ -0,0 +1,29 @@
1
+ module.exports = class Queue {
2
+ constructor() {
3
+ this._items = []
4
+ this._head = 0
5
+ }
6
+
7
+ get length() {
8
+ return this._items.length - this._head
9
+ }
10
+
11
+ push(item) {
12
+ this._items.push(item)
13
+ }
14
+
15
+ shift() {
16
+ if (this._head === this._items.length) return undefined
17
+
18
+ const item = this._items[this._head]
19
+
20
+ this._items[this._head++] = undefined
21
+
22
+ if (this._head === this._items.length) {
23
+ this._items = []
24
+ this._head = 0
25
+ }
26
+
27
+ return item
28
+ }
29
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-fs",
3
- "version": "4.8.7",
3
+ "version": "4.8.8",
4
4
  "description": "Native file system operations for Bare",
5
5
  "exports": {
6
6
  "./package": "./package.json",
@@ -51,8 +51,7 @@
51
51
  "bare-events": "^2.5.4",
52
52
  "bare-path": "^3.0.0",
53
53
  "bare-stream": "^2.6.4",
54
- "bare-url": "^2.2.2",
55
- "fast-fifo": "^1.3.2"
54
+ "bare-url": "^2.2.2"
56
55
  },
57
56
  "devDependencies": {
58
57
  "bare-buffer": "^3.0.2",
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file