An error caused by the new version of buffertools
Miaonster opened this issue · 2 comments
Miaonster commented
Hi @rook2pawn , I got an error when using this repository:
/THE/PATH/TO/filecompare/lib/index.js:32
var isEqual = s1.equals(s2);
^
TypeError: Object 1
has no method 'equals'
at Object.h2 (/THE/PATH/TO/filecompare/lib/index.js:32:26)
at Object.wrapper [as oncomplete] (fs.js:459:17)
I installed it with npm install
, and the version is 0.0.2, as described on the npm site. After some debugging and searching, I found this repository has a dependency buffertools, which has changed its API now. buffertools stop extending Buffer
's prototype by default. But we can use another way to do that. If a Buffer
needs to use .equals()
, it should add require('buffertools').extend();
instead of require('buffertools');
.
You can find more details here -> extend Buffer.prototype.
Wish you can update the repository and publish it to npm, thanks.
Miaonster commented
Great!