Skip to content

Commit 4cc79c1

Browse files
authored
replace xo and prettier with eslint (projectwallace#17)
1 parent 1b6ab04 commit 4cc79c1

File tree

3 files changed

+253
-3401
lines changed

3 files changed

+253
-3401
lines changed

index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const extractCss = async url => {
2121
// Start CSS coverage. This is the meat and bones of this module
2222
await page.coverage.startCSSCoverage()
2323

24-
const response = await page.goto(url, { waitUntil: 'networkidle2' })
24+
const response = await page.goto(url, {waitUntil: 'networkidle2'})
2525

2626
// Make sure that we only try to extract CSS from valid pages.
2727
// Bail out if the response is an invalid request (400, 500)
@@ -63,14 +63,14 @@ const extractCss = async url => {
6363
// we requested is an indication that this was a <style> tag
6464
.filter(styles => styles.url !== url)
6565
// The `text` property contains the actual CSS
66-
.map(({ text }) => text)
66+
.map(({text}) => text)
6767
.join('')
6868

6969
return Promise.resolve(styleSheetsApiCss + coverageCss)
7070
}
7171

7272
module.exports = async (req, res) => {
73-
const url = normalizeUrl(req.url.slice(1), { stripWWW: false })
73+
const url = normalizeUrl(req.url.slice(1), {stripWWW: false})
7474

7575
if (!isUrl(url)) {
7676
res.statusCode = 406
@@ -89,9 +89,9 @@ module.exports = async (req, res) => {
8989
}
9090

9191
try {
92-
const css = url.endsWith('.css')
93-
? (await got(url)).body
94-
: await extractCss(url)
92+
const css = url.endsWith('.css') ?
93+
(await got(url)).body :
94+
await extractCss(url)
9595

9696
res.setHeader('Content-Type', 'text/css')
9797
res.statusCode = 200

0 commit comments

Comments
 (0)