Skip to content

Commit

Permalink
refactor: use consistent BigInt(n) syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
kdenhartog authored Feb 24, 2020
1 parent 3a7e49a commit 419d09b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/help/key_object.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* global BigInt */

const { keyObjectSupported } = require('./runtime_support')

let createPublicKey
Expand Down Expand Up @@ -326,7 +328,7 @@ if (keyObjectSupported) {
const parsed = RSAPublicKey.decode(key, format, { label })

// special case when private pkcs1 PEM / DER is used with createPublicKey
if (parsed.n === 0n) {
if (parsed.n === BigInt(0)) {
return createPublicKey(createPrivateKey({ key, format, type, passphrase }))
}

Expand Down
1 change: 1 addition & 0 deletions lib/help/key_utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* global BigInt */

const { EOL } = require('os')

const { name: secp256k1 } = require('../jwk/key/secp256k1_crv')
Expand Down

0 comments on commit 419d09b

Please sign in to comment.