Skip to content

Commit faade86

Browse files
committed
[Fix] restore node 0.10 support
1 parent 5a0f159 commit faade86

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

.github/workflows/node-aught.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ jobs:
66
tests:
77
uses: ljharb/actions/.github/workflows/node.yml@main
88
with:
9-
range: '0.12 - 10'
9+
range: '0.10 - 10'
1010
type: minors
1111
command: npm run tests-only
1212

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
},
4949
"browser": "browser/index.js",
5050
"engines": {
51-
"node": ">= 0.12"
51+
"node": ">= 0.10"
5252
},
5353
"auto-changelog": {
5454
"output": "CHANGELOG.md",

test/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,18 @@ var parseKeys = require('parse-asn1');
1111
var bCrypto = require('../browser');
1212
var fixtures = require('./fixtures');
1313

14+
var supportsPassphrases = semver.satisfies(process.versions.node, '>= 0.11.8');
15+
1416
fixtures.valid.rsa.forEach(function (f) {
1517
var message = Buffer.from(f.message);
1618
var pub = Buffer.from(f['public'], 'base64');
1719
var priv;
1820

1921
if (f.passphrase) {
22+
if (!supportsPassphrases) {
23+
console.info('skipping passphrase test on a node version that lacks support for it');
24+
return;
25+
}
2026
priv = {
2127
key: Buffer.from(f['private'], 'base64'),
2228
passphrase: f.passphrase
@@ -96,6 +102,10 @@ fixtures.valid.ec.forEach(function (f) {
96102
var priv;
97103

98104
if (f.passphrase) {
105+
if (!supportsPassphrases) {
106+
console.info('skipping passphrase test on a node version that lacks support for it');
107+
return;
108+
}
99109
priv = {
100110
key: Buffer.from(f['private'], 'base64'),
101111
passphrase: f.passphrase

0 commit comments

Comments
 (0)