mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
chore: drop Node.js v6 support (#5045)
Node.js v6 was end-of-life'd in April, 2019, with AWS Lambda prohibiting updaets to the Node.js v6 runtime since June 30, 2019. This makes it quite safe for us to remove the Node 6 support from the repository.
This commit is contained in:
@@ -15,11 +15,12 @@
|
||||
*/
|
||||
|
||||
const path = require('path');
|
||||
const util = require('util');
|
||||
const fs = require('fs');
|
||||
|
||||
const readFileAsync = promisify(fs.readFile);
|
||||
const readdirAsync = promisify(fs.readdir);
|
||||
const writeFileAsync = promisify(fs.writeFile);
|
||||
const readFileAsync = util.promisify(fs.readFile);
|
||||
const readdirAsync = util.promisify(fs.readdir);
|
||||
const writeFileAsync = util.promisify(fs.writeFile);
|
||||
|
||||
const PROJECT_DIR = path.join(__dirname, '..', '..');
|
||||
|
||||
@@ -110,26 +111,3 @@ class Source {
|
||||
}
|
||||
module.exports = Source;
|
||||
|
||||
/**
|
||||
* @param {function(?)} nodeFunction
|
||||
* @return {function(?):!Promise<?>}
|
||||
*/
|
||||
function promisify(nodeFunction) {
|
||||
/**
|
||||
* @param {!Array<?>} options
|
||||
* @return {!Promise<?>}
|
||||
*/
|
||||
return function(...options) {
|
||||
return new Promise(function(fulfill, reject) {
|
||||
options.push(callback);
|
||||
nodeFunction.call(null, ...options);
|
||||
function callback(err, result) {
|
||||
if (err)
|
||||
reject(err);
|
||||
else
|
||||
fulfill(result);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user