Skip to content

Commit c9d98ec

Browse files
committed
Temp non-null assertion operator
1 parent d3b7a41 commit c9d98ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/keypair/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ export function createKeypairFromPeerId(peerId: PeerId): IKeypair {
5353
const pub = keysPBM.PublicKey.decode(peerId.publicKey);
5454
if (peerId.privateKey) {
5555
const priv = keysPBM.PrivateKey.decode(peerId.privateKey);
56-
return createKeypair(KeypairType[pub.Type] as KeypairType, toBuffer(priv.Data), toBuffer(pub.Data));
56+
return createKeypair(KeypairType[pub.Type!] as KeypairType, toBuffer(priv.Data!), toBuffer(pub.Data!));
5757
} else {
58-
return createKeypair(KeypairType[pub.Type] as KeypairType, undefined, toBuffer(pub.Data));
58+
return createKeypair(KeypairType[pub.Type!] as KeypairType, undefined, toBuffer(pub.Data!));
5959
}
6060
}

0 commit comments

Comments
 (0)