From 64f133590fcac72c1bc042bf7b4ab729d7e03316 Mon Sep 17 00:00:00 2001 From: "Anders D. Johnson" Date: Thu, 13 Apr 2023 13:06:43 -0500 Subject: [PATCH] fix: safe access navigation entry type (#290) * fix: safe access navigation entry type * Remove the default to unknown per Barry --- src/lib/initMetric.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/initMetric.ts b/src/lib/initMetric.ts index d61ed9cc..4691db72 100644 --- a/src/lib/initMetric.ts +++ b/src/lib/initMetric.ts @@ -31,7 +31,7 @@ export const initMetric = (name: Metric['name'], value?: number): Metric => { navigationType = 'prerender'; } else if (document.wasDiscarded) { navigationType = 'restore'; - } else { + } else if (navEntry.type) { navigationType = navEntry.type.replace( /_/g, '-'