Closed robertkiel closed 4 years ago
Tell Typescript that isPeerId(id) returns true if, and only if, id is of type PeerId.
isPeerId(id)
id
PeerId
See https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates
Thanks for the PR @robertkiel @carsonfarmer mind having a look?
Oooh, this is nice. Good call.
Tell Typescript that
isPeerId(id)
returns true if, and only if,id
is of typePeerId
.See https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates