MCPcopy
hub / github.com/Effect-TS/effect / parseMeta

Function parseMeta

packages/effect/src/Arbitrary.ts:369–381  ·  view source on GitHub ↗
(ast: SchemaAST.AST)

Source from the content-addressed store, hash-verified

367}
368
369function parseMeta(ast: SchemaAST.AST): [SchemaAST.SchemaIdAnnotation | undefined, Record<string | symbol, unknown>] {
370 const jsonSchema = SchemaAST.getJSONSchemaAnnotation(ast).pipe(
371 Option.filter(Predicate.isReadonlyRecord),
372 Option.getOrUndefined
373 )
374 const schemaId = Option.getOrElse(SchemaAST.getSchemaIdAnnotation(ast), () => undefined)
375 const schemaParams = Option.fromNullable(schemaId).pipe(
376 Option.map((id) => ast.annotations[id]),
377 Option.filter(Predicate.isReadonlyRecord),
378 Option.getOrUndefined
379 )
380 return [schemaId, { ...schemaParams, ...jsonSchema }]
381}
382
383/** @internal */
384export const getDescription = wrapGetDescription(

Callers 1

Arbitrary.tsFile · 0.85

Calls 2

pipeMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…