diff --git a/README.md b/README.md index ddc3255..1cb9f21 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ import { lighthouseCheck } from '@foo-software/lighthouse-check'; (async () => { const response = await lighthouseCheck({ - slackWebhookUrl: 'https://www.my-slack-webhook-url.com' + slackWebhookUrl: 'https://www.my-slack-webhook-url.com', urls: [ 'https://www.foo.software/lighthouse', 'https://www.foo.software/contact' diff --git a/src/localLighthouse.js b/src/localLighthouse.js index d26d4e2..5af6cd8 100644 --- a/src/localLighthouse.js +++ b/src/localLighthouse.js @@ -15,10 +15,9 @@ const getScoresFromFloat = scores => Object.keys(scores).reduce( (accumulator, current) => ({ ...accumulator, - [current]: - typeof scores[current] !== 'number' - ? 0 - : Math.floor(scores[current] * 100) + ...(typeof scores[current] === 'number' && { + [current]: Math.floor(scores[current] * 100) + }) }), {} );