diff --git a/packages/browser/src/core/page/get-page-context.ts b/packages/browser/src/core/page/get-page-context.ts index 279503fc5..7d51547de 100644 --- a/packages/browser/src/core/page/get-page-context.ts +++ b/packages/browser/src/core/page/get-page-context.ts @@ -43,7 +43,7 @@ export const createBufferedPageContext = ( }) // my clever/dubious way of making sure this type guard does not get out sync with the type definition -const expectedBufferedPageContextKeys = Object.keys( +const BUFFERED_PAGE_CONTEXT_KEYS = Object.keys( createBufferedPageContext('', '', '', '', '', '') ) as (keyof BufferedPageContext)[] @@ -55,9 +55,9 @@ export function isBufferedPageContext( // if object has both the correct key names AND the right number of keys, assume it's a BufferedPageContext const bufferedPageCtxKeys = Object.keys(bufferedPageCtx) - if (bufferedPageCtxKeys.length !== expectedBufferedPageContextKeys.length) + if (bufferedPageCtxKeys.length !== BUFFERED_PAGE_CONTEXT_KEYS.length) return false - for (const k of expectedBufferedPageContextKeys) { + for (const k of BUFFERED_PAGE_CONTEXT_KEYS) { if (!(k in bufferedPageCtx)) return false } return true