MCPcopy Index your code
hub / github.com/Effect-TS/effect / annotations

Function annotations

packages/effect/src/SchemaAST.ts:2110–2121  ·  view source on GitHub ↗
(ast: AST, overrides: Annotations)

Source from the content-addressed store, hash-verified

2108 * @since 3.10.0
2109 */
2110export const annotations = (ast: AST, overrides: Annotations): AST => {
2111 const d = Object.getOwnPropertyDescriptors(ast)
2112 const base: any = { ...ast.annotations }
2113 delete base[IdentifierAnnotationId]
2114 const value = { ...base, ...overrides }
2115 const surrogate = getSurrogateAnnotation(ast)
2116 if (Option.isSome(surrogate)) {
2117 value[SurrogateAnnotationId] = annotations(surrogate.value, overrides)
2118 }
2119 d.annotations.value = value
2120 return Object.create(Object.getPrototypeOf(ast), d)
2121}
2122
2123/**
2124 * Equivalent at runtime to the TypeScript type-level `keyof` operator.

Callers 1

typeASTFunction · 0.70

Calls 1

createMethod · 0.80

Tested by

no test coverage detected