Skip to content

Commit 124dd7b

Browse files
authored
feat: improve output (#63)
* docs: update readme * feat: only display scores when they exist
1 parent be2d350 commit 124dd7b

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ import { lighthouseCheck } from '@foo-software/lighthouse-check';
188188

189189
(async () => {
190190
const response = await lighthouseCheck({
191-
slackWebhookUrl: 'https://www.my-slack-webhook-url.com'
191+
slackWebhookUrl: 'https://www.my-slack-webhook-url.com',
192192
urls: [
193193
'https://www.foo.software/lighthouse',
194194
'https://www.foo.software/contact'

src/localLighthouse.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ const getScoresFromFloat = scores =>
1515
Object.keys(scores).reduce(
1616
(accumulator, current) => ({
1717
...accumulator,
18-
[current]:
19-
typeof scores[current] !== 'number'
20-
? 0
21-
: Math.floor(scores[current] * 100)
18+
...(typeof scores[current] === 'number' && {
19+
[current]: Math.floor(scores[current] * 100)
20+
})
2221
}),
2322
{}
2423
);

0 commit comments

Comments
 (0)