tschaub / mock-fs

Configurable mock for the fs module
https://npmjs.org/package/mock-fs
Other
906 stars 85 forks source link

Fix bug in writeBuffer call and expose getDescriptorById #311

Open Meigyoku-Thmn opened 3 years ago

Meigyoku-Thmn commented 3 years ago

There is a this.writeBuffer call that use the wrong argument "string.length", the correct one is "buffer.length". Also I think exposing the getDescriptorById method is a good idea. That way, anyone use this library has the opportunity to access the file's metadata and content directly, or get/set the file's position.