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 51c4aa6 commit bc8ba9b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/browser/src/core/page/get-page-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export const createBufferedPageContext = (
r: referrer,
})

// my clever/dubious way of making sure this type guard does not get out sync with the type definition
const expectedBufferedPageContextKeys = Object.keys(
createBufferedPageContext('', '', '', '', '', '')
) as (keyof BufferedPageContext)[]
Expand All @@ -51,7 +52,6 @@ export function isBufferedPageContext(
): bufferedPageCtx is BufferedPageContext {
if (!isPlainObject(bufferedPageCtx)) return false
if (bufferedPageCtx.__t !== BufferedPageContextDiscriminant) return false
// my clever/dubious way of making sure this type guard does not get out sync with the type definition

// if object has both the correct key names AND the right number of keys, assume it's a BufferedPageContext
const bufferedPageCtxKeys = Object.keys(bufferedPageCtx)
Expand Down

0 comments on commit bc8ba9b

Please sign in to comment.