Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix typings #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix typings #6

wants to merge 1 commit into from

Conversation

amishshah
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant