v2.7.14: node v6 fix

This commit is contained in:
AJ ONeal 2019-04-07 18:27:49 -06:00
parent 461ad43620
commit 1b388788d8
3 changed files with 11 additions and 9 deletions

View File

@ -10,12 +10,14 @@ try {
} catch(e) { } catch(e) {
PromiseA = global.Promise; PromiseA = global.Promise;
} }
var util = require('util'); if (!PromiseA.promisify) {
PromiseA.promisify = require('util');
}
function promisifyAllSelf(obj) { function promisifyAllSelf(obj) {
if (obj.__promisified) { return obj; } if (obj.__promisified) { return obj; }
Object.keys(obj).forEach(function (key) { Object.keys(obj).forEach(function (key) {
if ('function' === typeof obj[key] && !/Async$/.test(key)) { if ('function' === typeof obj[key] && !/Async$/.test(key)) {
obj[key + 'Async'] = util.promisify(obj[key]); obj[key + 'Async'] = PromiseA.promisify(obj[key]);
} }
}); });
obj.__promisified = true; obj.__promisified = true;
@ -30,7 +32,7 @@ function promisifyAllStore(obj) {
// wrap just in case it's synchronous (or improperly throws) // wrap just in case it's synchronous (or improperly throws)
p = function (opts) { return PromiseA.resolve().then(function () { obj[key](opts); }); }; p = function (opts) { return PromiseA.resolve().then(function () { obj[key](opts); }); };
} else { } else {
p = util.promisify(obj[key]); p = PromiseA.promisify(obj[key]);
} }
// internal backwards compat // internal backwards compat
obj[key + 'Async'] = p; obj[key + 'Async'] = p;

8
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock", "name": "greenlock",
"version": "2.7.13", "version": "2.7.14",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -18,9 +18,9 @@
} }
}, },
"acme-v2": { "acme-v2": {
"version": "1.7.5", "version": "1.7.6",
"resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.7.5.tgz", "resolved": "https://registry.npmjs.org/acme-v2/-/acme-v2-1.7.6.tgz",
"integrity": "sha512-jru7mOO/gT/ZfpRJo7m8QDWy2xea7A0xZsR9zlvMfm0+kQsE8DI3DJXOVN/1iMeQOMCHp0sZVqYRqB42XAKAdw==", "integrity": "sha512-k4ZlTI8txU7AweKny2MK9EAJTSCSu9ueodrv3v91r2NckTuHRu8ELzN3LbP5zlTrb2coNFay4uLcA3u4ona67A==",
"requires": { "requires": {
"@coolaj86/urequest": "^1.3.6", "@coolaj86/urequest": "^1.3.6",
"rsa-compat": "^2.0.6" "rsa-compat": "^2.0.6"

View File

@ -1,6 +1,6 @@
{ {
"name": "greenlock", "name": "greenlock",
"version": "2.7.13", "version": "2.7.14",
"description": "Let's Encrypt for node.js on npm", "description": "Let's Encrypt for node.js on npm",
"main": "index.js", "main": "index.js",
"files": [ "files": [
@ -39,7 +39,7 @@
}, },
"dependencies": { "dependencies": {
"acme": "^1.3.0", "acme": "^1.3.0",
"acme-v2": "^1.7.5", "acme-v2": "^1.7.6",
"cert-info": "^1.5.1", "cert-info": "^1.5.1",
"keypairs": "^1.2.14", "keypairs": "^1.2.14",
"le-challenge-dns": "^3.0.3", "le-challenge-dns": "^3.0.3",