multiformats / js-cid

CID implementation in JavaScript
MIT License
97 stars 39 forks source link

fix: update typedefs to reflect API changes #81

Closed Gozala closed 5 years ago

Gozala commented 5 years ago

Add 4th optional parameter introduced by #77

vmx commented 5 years ago

If it's an external file, could things like that be checked somehow? Even without this patch running flow won't result in an error.

Gozala commented 5 years ago

If it's an external file, could things like that be checked somehow? Even without this patch running flow won't result in an error.

Flow will ignore anything that doesn't start with // @flow in this case it's typedefs which were valid before and are still valid, that's why it will type check.

Only way to keep implementation to comply with type definition is to annotate implementation accordingly. That is to say you could have significant type definitions in separate file and only few comments in the source, but there will still need to be some comments in the source.