We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d3b7a41 commit c9d98ecCopy full SHA for c9d98ec
src/keypair/index.ts
@@ -53,8 +53,8 @@ export function createKeypairFromPeerId(peerId: PeerId): IKeypair {
53
const pub = keysPBM.PublicKey.decode(peerId.publicKey);
54
if (peerId.privateKey) {
55
const priv = keysPBM.PrivateKey.decode(peerId.privateKey);
56
- return createKeypair(KeypairType[pub.Type] as KeypairType, toBuffer(priv.Data), toBuffer(pub.Data));
+ return createKeypair(KeypairType[pub.Type!] as KeypairType, toBuffer(priv.Data!), toBuffer(pub.Data!));
57
} else {
58
- return createKeypair(KeypairType[pub.Type] as KeypairType, undefined, toBuffer(pub.Data));
+ return createKeypair(KeypairType[pub.Type!] as KeypairType, undefined, toBuffer(pub.Data!));
59
}
60
0 commit comments