Files
klz-cables.com/.pnpm-store/v10/files/ea/d67fd585352fa9fc28840a5ad97fc00dbbeb9d804c10e50c6cde883cc02c2e1a176cb6be1ea34948a157f5313311421ac90dfa4c1e965b42d0d6335ce7e4c2
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
2.9 KiB
Plaintext

{"version":3,"file":"bindReporter.js","sources":["../../../../../src/metrics/web-vitals/lib/bindReporter.ts"],"sourcesContent":["/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { MetricRatingThresholds, MetricType } from '../types';\n\nconst getRating = (value: number, thresholds: MetricRatingThresholds): MetricType['rating'] => {\n if (value > thresholds[1]) {\n return 'poor';\n }\n if (value > thresholds[0]) {\n return 'needs-improvement';\n }\n return 'good';\n};\n\nexport const bindReporter = <MetricName extends MetricType['name']>(\n callback: (metric: Extract<MetricType, { name: MetricName }>) => void,\n metric: Extract<MetricType, { name: MetricName }>,\n thresholds: MetricRatingThresholds,\n reportAllChanges?: boolean,\n) => {\n let prevValue: number;\n let delta: number;\n return (forceReport?: boolean) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue ?? 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n metric.rating = getRating(metric.value, thresholds);\n callback(metric);\n }\n }\n }\n };\n};\n"],"names":[],"mappings":"AAkBA,MAAM,YAAY,CAAC,KAAK,EAAU,UAAU,KAAmD;AAC/F,EAAE,IAAI,KAAA,GAAQ,UAAU,CAAC,CAAC,CAAC,EAAE;AAC7B,IAAI,OAAO,MAAM;AACjB,EAAE;AACF,EAAE,IAAI,KAAA,GAAQ,UAAU,CAAC,CAAC,CAAC,EAAE;AAC7B,IAAI,OAAO,mBAAmB;AAC9B,EAAE;AACF,EAAE,OAAO,MAAM;AACf,CAAC;;AAEM,MAAM,eAAe;AAC5B,EAAE,QAAQ;AACV,EAAE,MAAM;AACR,EAAE,UAAU;AACZ,EAAE,gBAAgB;AAClB,KAAK;AACL,EAAE,IAAI,SAAS;AACf,EAAE,IAAI,KAAK;AACX,EAAE,OAAO,CAAC,WAAW,KAAe;AACpC,IAAI,IAAI,MAAM,CAAC,KAAA,IAAS,CAAC,EAAE;AAC3B,MAAM,IAAI,WAAA,IAAe,gBAAgB,EAAE;AAC3C,QAAQ,KAAA,GAAQ,MAAM,CAAC,KAAA,IAAS,SAAA,IAAa,CAAC,CAAC;;AAE/C;AACA;AACA;AACA;AACA,QAAQ,IAAI,KAAA,IAAS,SAAA,KAAc,SAAS,EAAE;AAC9C,UAAU,SAAA,GAAY,MAAM,CAAC,KAAK;AAClC,UAAU,MAAM,CAAC,KAAA,GAAQ,KAAK;AAC9B,UAAU,MAAM,CAAC,MAAA,GAAS,SAAS,CAAC,MAAM,CAAC,KAAK,EAAE,UAAU,CAAC;AAC7D,UAAU,QAAQ,CAAC,MAAM,CAAC;AAC1B,QAAQ;AACR,MAAM;AACN,IAAI;AACJ,EAAE,CAAC;AACH;;;;"}