bare-fs 4.1.1 → 4.1.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 +4 -0
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -848,6 +848,8 @@ function ftruncate(fd, len, cb) {
848
848
  )
849
849
  }
850
850
 
851
+ if (typeof len !== 'number') len = 0
852
+
851
853
  const req = getReq()
852
854
  req.callback = cb
853
855
  binding.ftruncate(req.handle, fd, len)
@@ -873,6 +875,8 @@ function ftruncateSync(fd, len) {
873
875
  )
874
876
  }
875
877
 
878
+ if (typeof len !== 'number') len = 0
879
+
876
880
  binding.ftruncateSync(fd, len)
877
881
  }
878
882
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bare-fs",
3
- "version": "4.1.1",
3
+ "version": "4.1.2",
4
4
  "description": "Native file system for Javascript",
5
5
  "exports": {
6
6
  "./package": "./package.json",