js-peer-id
js-peer-id copied to clipboard
Introduce `ToPeerId` type for things that can be turned into PeerId
Based on discussion here https://github.com/ipfs/js-ipfs/pull/3365/files/fa7c2c13c43bab922052104fe8aff863d9725e9b?file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.ts#r520418521
Cross posting from https://github.com/ipfs/js-ipfs/pull/3365/files/fa7c2c13c43bab922052104fe8aff863d9725e9b?file-filters%5B%5D=.js&file-filters%5B%5D=.json&file-filters%5B%5D=.ts#r522871631
We already have several
createFrom*
functions inpeer-id
, but they are targeted to a specific type https://github.com/libp2p/js-peer-id#import I think this would be nice to have, I would just go withPeerId.createFrom(param: ToPeerId)
to be consistent with what we already have.