From 748945868e7efacee209d990e770cf646234ef7e Mon Sep 17 00:00:00 2001 From: ekremney Date: Mon, 22 Apr 2024 15:42:24 +0200 Subject: [PATCH] fix: no conditional chaining --- src/index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 305999a..89ed4a1 100644 --- a/src/index.js +++ b/src/index.js @@ -99,9 +99,9 @@ sampleRUM.drain('cwv', (() => { data.cwv[measurement.name] = measurement.value; if (measurement.name === 'LCP' && measurement.entries.length > 0) { - const { element } = measurement.entries.pop(); - data.target = sampleRUM.targetselector(element); - data.source = sampleRUM.sourceselector(element) || element?.outerHTML.slice(0, 30); + const { element: el } = measurement.entries.pop(); + data.target = sampleRUM.targetselector(el); + data.source = sampleRUM.sourceselector(el) || (el && el.outerHTML.slice(0, 30)); } sampleRUM('cwv', data);