mirror of
https://github.com/fluencelabs/js-peer-id
synced 2025-04-25 06:12:16 +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:
parent
00819ba4eb
commit
f775e3509b
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user