Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
silesky committed Sep 26, 2023
1 parent bc8ba9b commit 8a19bc3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/browser/src/core/page/get-page-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)[]

Expand All @@ -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
Expand Down

0 comments on commit 8a19bc3

Please sign in to comment.