MCPcopy
hub / github.com/code-hike/codehike / parseRoot

Function parseRoot

packages/codehike/src/blocks.ts:18–28  ·  view source on GitHub ↗
(
  Content: MDXContent,
  Schema: z.ZodType<Output, Def, Input> | undefined,
  props: MDXProps = {},
)

Source from the content-addressed store, hash-verified

16 props?: MDXProps,
17): Output
18export function parseRoot<Output, Def extends ZodTypeDef, Input>(
19 Content: MDXContent,
20 Schema: z.ZodType<Output, Def, Input> | undefined,
21 props: MDXProps = {},
22) {
23 const data = parse(Content, props || {})
24 if (Schema) {
25 return parseProps(data, Schema)
26 }
27 return data
28}
29
30export const Block = z.object({
31 title: z.string().optional(),

Callers 15

AllCodeDemosFunction · 0.90
demo.tsxFile · 0.90
LayoutExampleFunction · 0.90
PreviewImplementationFunction · 0.90
CodeExampleFunction · 0.90
00.jsxFile · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
05.jsxFile · 0.85

Calls 2

parseFunction · 0.85
parsePropsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…