Files
klz-cables.com/.pnpm-store/v10/files/9d/e10581f6321398853841226ec767b8af3b6c97b4c0729bb2de6c73f0e1ca4ab04e4f2f2b8232264cd3bf76f2f65c6ad02b627d1c14ea3e11b24ba21c20f4ff
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

53 lines
1.6 KiB
Plaintext

import { WINDOW } from '../../../types.js';
import { generateUniqueID } from './generateUniqueID.js';
import { getActivationStart } from './getActivationStart.js';
import { getNavigationEntry } from './getNavigationEntry.js';
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const initMetric = (name, value = -1) => {
const navEntry = getNavigationEntry();
let navigationType = 'navigate';
if (navEntry) {
if (WINDOW.document?.prerendering || getActivationStart() > 0) {
navigationType = 'prerender';
} else if (WINDOW.document?.wasDiscarded) {
navigationType = 'restore';
} else if (navEntry.type) {
navigationType = navEntry.type.replace(/_/g, '-') ;
}
}
// Use `entries` type specific for the metric.
const entries = [];
return {
name,
value,
rating: 'good' , // If needed, will be updated when reported. `const` to keep the type from widening to `string`.
delta: 0,
entries,
id: generateUniqueID(),
navigationType,
};
};
export { initMetric };
//# sourceMappingURL=initMetric.js.map