bare-fs 1.13.0 → 1.13.2

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 +7 -8
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1643,18 +1643,17 @@ class Watcher extends EventEmitter {
1643
1643
  this.close()
1644
1644
  this.emit('error', err)
1645
1645
  } else {
1646
- let eventType
1646
+ const path = this._encoding === 'buffer'
1647
+ ? Buffer.from(filename)
1648
+ : Buffer.from(filename).toString(this._encoding)
1647
1649
 
1648
1650
  if (events & binding.UV_RENAME) {
1649
- eventType = 'rename'
1650
- } else if (events & binding.UV_CHANGE) {
1651
- eventType = 'change'
1651
+ this.emit('change', 'rename', path)
1652
1652
  }
1653
1653
 
1654
- this.emit('change', eventType, this._encoding === 'buffer'
1655
- ? Buffer.from(filename)
1656
- : Buffer.from(filename).toString(this._encoding)
1657
- )
1654
+ if (events & binding.UV_CHANGE) {
1655
+ this.emit('change', 'change', path)
1656
+ }
1658
1657
  }
1659
1658
  }
1660
1659
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-fs",
3
- "version": "1.13.0",
3
+ "version": "1.13.2",
4
4
  "description": "Native file system for Javascript",
5
5
  "main": "index.js",
6
6
  "files": [