chore: update index.d.ts (#115)

Tell Typescript that `isPeerId(id)` returns true if, and only if, `id` is of type `PeerId`.

See https://www.typescriptlang.org/docs/handbook/advanced-types.html#using-type-predicates
This commit is contained in:
Robert Kiel 2020-02-19 17:51:59 +01:00 committed by GitHub
parent 00819ba4eb
commit f775e3509b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

2
src/index.d.ts vendored
View File

@ -38,7 +38,7 @@ declare namespace PeerId {
* Checks if a value is an instance of PeerId.
* @param id The value to check.
*/
function isPeerId(id: any): boolean
function isPeerId(id: any): id is PeerId
/**
* Create a new PeerId.