The wrap function only deals with first two arguments of the original function's callback. This may not work properly for any function which give more than 2 args in their result callback like fs.read and fs.write. They produce 3 args in the result callbacks (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer)
https://github.com/bcoin-org/blgr/blob/master/lib/fs.js#L15
The wrap function only deals with first two arguments of the original function's callback. This may not work properly for any function which give more than 2 args in their result callback like fs.read and fs.write. They produce 3 args in the result callbacks (err: NodeJS.ErrnoException, bytesRead: number, buffer: TBuffer)
https://github.com/bcoin-org/blgr/blob/master/lib/fs.js#L15