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

Function toASTAnnotations

packages/effect/src/Schema.ts:255–272  ·  view source on GitHub ↗
(
  annotations?: AllAnnotations<A, TypeParameters>
)

Source from the content-addressed store, hash-verified

253}
254
255const toASTAnnotations = <A, TypeParameters extends ReadonlyArray<any>>(
256 annotations?: AllAnnotations<A, TypeParameters>
257): AST.Annotations => {
258 if (!annotations) {
259 return {}
260 }
261 const out: Types.Mutable<AST.Annotations> = { ...annotations }
262
263 for (const key in builtInAnnotations) {
264 if (key in annotations) {
265 const id = builtInAnnotations[key as keyof typeof builtInAnnotations]
266 out[id] = annotations[key as keyof typeof annotations]
267 delete out[key]
268 }
269 }
270
271 return out
272}
273
274const mergeSchemaAnnotations = <A>(ast: AST.AST, annotations: Annotations.Schema<A>): AST.AST =>
275 AST.annotations(ast, toASTAnnotations(annotations))

Callers 9

mergeSchemaAnnotationsFunction · 0.85
declareConstructorFunction · 0.85
declarePrimitiveFunction · 0.85
fromBrandFunction · 0.85
annotationsMethod · 0.85
annotationsMethod · 0.85
annotationsMethod · 0.85
brandFunction · 0.85
filterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…