MCPcopy Index your code
hub / github.com/nodejs/nodejs.org / assignClientContext

Function assignClientContext

apps/site/util/context.ts:3–20  ·  view source on GitHub ↗
(
  props: Partial<T>
)

Source from the content-addressed store, hash-verified

1import type { ClientSharedServerContext } from '#site/types';
2
3export const assignClientContext = <T extends ClientSharedServerContext>(
4 props: Partial<T>
5) =>
6 ({
7 frontmatter: props.frontmatter ?? {},
8 pathname: props.pathname ?? '',
9 headings: props.headings ?? [],
10 readingTime: props.readingTime ?? {
11 text: '',
12 minutes: 0,
13 time: 0,
14 words: 0,
15 },
16 filename: props.filename ?? '',
17 os: props.os ?? 'OTHER',
18 architecture: props.architecture ?? 'x64',
19 bitness: props.bitness ?? 64,
20 }) as T;

Callers 5

client-context.tsFile · 0.90
setClientContextFunction · 0.90
matterProvider.tsxFile · 0.90
MatterProviderFunction · 0.90
context.test.mjsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected