Compare commits

...

4 Commits

Author SHA1 Message Date
1d86506c64 chore: release version v0.13.9 2020-02-19 12:06:43 -05:00
9dc7ce5f5e chore: update contributors 2020-02-19 12:06:42 -05:00
f775e3509b 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
2020-02-19 11:51:59 -05:00
00819ba4eb chore: update index.d.ts (#116)
This tells Typescript that `id` is immutable.
2020-02-19 09:17:30 -05:00
3 changed files with 9 additions and 3 deletions

View File

@ -1,3 +1,8 @@
<a name="0.13.9"></a>
## [0.13.9](https://github.com/libp2p/js-peer-id/compare/v0.13.8...v0.13.9) (2020-02-19)
<a name="0.13.8"></a>
## [0.13.8](https://github.com/libp2p/js-peer-id/compare/v0.13.6...v0.13.8) (2020-02-18)

View File

@ -1,6 +1,6 @@
{
"name": "peer-id",
"version": "0.13.8",
"version": "0.13.9",
"description": "IPFS Peer Id implementation in Node.js",
"leadMaintainer": "Vasco Santos <santos.vasco10@gmail.com>",
"main": "src/index.js",
@ -74,6 +74,7 @@
"Prashanth Chandra <coolshanth94@gmail.com>",
"Richard Littauer <richard.littauer@gmail.com>",
"Richard Schneider <makaretu@gmail.com>",
"Robert Kiel <robert.kiel@validitylabs.org>",
"Stephen Whitmore <stephen.whitmore@gmail.com>",
"Topper Bowers <topper@quorumcontrol.com>",
"Vasco Santos <vasco.santos@moxy.studio>",

4
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.
@ -105,7 +105,7 @@ declare class PeerId {
/**
* Raw id.
*/
id: Buffer;
readonly id: Buffer;
/**
* Private key.