Skip to content
This repository has been archived by the owner on Sep 3, 2021. It is now read-only.

Commit

Permalink
fix: turn isCID to a type guard
Browse files Browse the repository at this point in the history
This fixes regression caused by switch to generated typedefs which turned `isCID` to non type guard predicate.
For details on type guards see: https://www.typescriptlang.org/docs/handbook/advanced-types.html#user-defined-type-guards
  • Loading branch information
Gozala authored and vmx committed Dec 11, 2020
1 parent 14e55a1 commit 7413819
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,7 @@ class CID {
* Check if object is a CID instance
*
* @param {any} value
* @returns {boolean}
* @returns {value is CID}
*/
static isCID (value) {
return value instanceof CID || Boolean(value && value[symbol])
Expand Down

0 comments on commit 7413819

Please sign in to comment.