mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-07-02 18:31:38 +00:00
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:
2
src/index.d.ts
vendored
2
src/index.d.ts
vendored
@ -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.
|
||||
|
Reference in New Issue
Block a user