node-crc
node-crc copied to clipboard
Fix typings
Hi there! Firstly, thank you for making this library, I'm finding it very useful!
I'm using this library with TypeScript, and it's a bit cumbersome when dealing with the return type of the crc functions:
import { crc } from 'node-crc';
const result = crc(...someArguments);
if (!result) {
throw new Error('failure');
}
// here, result is of type `true | Buffer` instead of just Buffer,
// since the return type is given as `boolean | Buffer`
I've updated the typings to use the more correct return types of false | Buffer instead of boolean | Buffer.