Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): update dependency eslint to v6 #1378

Merged
merged 3 commits into from
Jun 22, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 35 additions & 35 deletions appengine/headless-chrome/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,40 +20,40 @@ const express = require('express');
const puppeteer = require('puppeteer');
const app = express();

let browser;

app.use(async (req, res) => {
const {url} = req.query;

if (!url) {
return res.send(
'Please provide URL as GET parameter, for example: <a href="/?url=https://example.com">?url=https://example.com</a>'
);
}

if (!browser) {
// [START gae_std_headless_chrome_full_sample_browser]
browser = await puppeteer.launch({
args: ['--no-sandbox'],
});
// [END gae_std_headless_chrome_full_sample_browser]
}

const page = await browser.newPage();
await page.goto(url);
const imageBuffer = await page.screenshot();

res.set('Content-Type', 'image/png');
res.send(imageBuffer);
});

const server = app.listen(process.env.PORT || 8080, err => {
if (err) {
return console.error(err);
}
const {port} = server.address();
console.info(`App listening on port ${port}`);
});
// [END gae_std_headless_chrome_full_sample]
async function main() {
// [START gae_std_headless_chrome_full_sample_browser]
const browser = await puppeteer.launch({
args: ['--no-sandbox'],
});
// [END gae_std_headless_chrome_full_sample_browser]

app.use(async (req, res) => {
const {url} = req.query;

if (!url) {
return res.send(
'Please provide URL as GET parameter, for example: <a href="/?url=https://example.com">?url=https://example.com</a>'
);
}

const page = await browser.newPage();
await page.goto(url);
const imageBuffer = await page.screenshot();

res.set('Content-Type', 'image/png');
res.send(imageBuffer);
});

const server = app.listen(process.env.PORT || 8080, err => {
if (err) {
return console.error(err);
}
const {port} = server.address();
console.info(`App listening on port ${port}`);
});
// [END gae_std_headless_chrome_full_sample]
}

main();

module.exports = app;
2 changes: 1 addition & 1 deletion appengine/websockets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.3.0",
"eslint": "^5.4.0",
"eslint": "^6.0.0",
"eslint-config-prettier": "^5.0.0",
"eslint-plugin-node": "^9.0.0",
"eslint-plugin-prettier": "^3.0.0",
Expand Down
2 changes: 1 addition & 1 deletion functions/dialogflow/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"devDependencies": {
"@google-cloud/functions-emulator": "^1.0.0-beta.5",
"@google-cloud/nodejs-repo-tools": "^3.3.0",
"eslint": "^5.12.0",
"eslint": "^6.0.0",
"eslint-plugin-promise": "^4.0.1",
"mocha": "^6.0.2",
"supertest": "^4.0.0"
Expand Down
10 changes: 6 additions & 4 deletions functions/headless-chrome/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ async function getBrowserPage() {
return browser.newPage();
}

async function main() {
page = await getBrowserPage();
}

main();

exports.screenshot = async (req, res) => {
const {url} = req.query;

Expand All @@ -36,10 +42,6 @@ exports.screenshot = async (req, res) => {
);
}

if (!page) {
page = await getBrowserPage();
}

await page.goto(url);
const imageBuffer = await page.screenshot();
res.set('Content-Type', 'image/png');
Expand Down
15 changes: 3 additions & 12 deletions iot/beta-features/gateway/gateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -341,18 +341,9 @@ const unbindDeviceFromAllGateways = async (
};

// for each gateway, make the call to unbind it
return new Promise(async (resolve, reject) => {
try {
await client.projects.locations.registries.unbindDeviceFromGateway(
unbindRequest
);
console.log('Unbound device from gateways', gateway.id);
resolve();
} catch (err) {
console.log('Could not unbind device', err);
reject();
}
});
return client.projects.locations.registries.unbindDeviceFromGateway(
unbindRequest
);
});

await Promise.all(promises);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"devDependencies": {
"@google-cloud/nodejs-repo-tools": "^3.3.0",
"eslint": "^5.9.0",
"eslint": "^6.0.0",
"eslint-config-prettier": "^5.0.0",
"eslint-plugin-node": "^9.0.0",
"eslint-plugin-prettier": "^3.1.0",
Expand Down