v1.2.3: bugfix double convert

This commit is contained in:
AJ ONeal 2019-03-05 07:37:43 -07:00
parent 4ab4cbd2ab
commit f1b4ccf792
2 changed files with 7 additions and 3 deletions

View File

@ -306,7 +306,9 @@ if ('gen' === opts.action || (!opts.action && !opts.names.length)) {
process.exit(1);
return;
}
kp = Promise.resolve(readKeypair());
var pair = readKeypair();
pair._convert = true;
kp = Promise.resolve();
}
if ('sign' === opts.action) {
@ -339,7 +341,9 @@ if ('sign' === opts.action) {
});
} else {
return kp.then(function (pair) {
return convertKeypair(pair);
if (pair._convert) {
return convertKeypair(pair);
}
});
}

View File

@ -1,6 +1,6 @@
{
"name": "keypairs",
"version": "1.2.0",
"version": "1.2.2",
"description": "Lightweight RSA/ECDSA keypair generation and JWK <-> PEM",
"main": "keypairs.js",
"files": [