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

Function addAnnotations

packages/effect/src/JSONSchema.ts:611–619  ·  view source on GitHub ↗
(jsonSchema: JsonSchema7, annotations: JsonSchemaAnnotations | undefined)

Source from the content-addressed store, hash-verified

609}
610
611function addAnnotations(jsonSchema: JsonSchema7, annotations: JsonSchemaAnnotations | undefined): JsonSchema7 {
612 if (annotations === undefined || Object.keys(annotations).length === 0) {
613 return jsonSchema
614 }
615 if ("$ref" in jsonSchema) {
616 return { allOf: [jsonSchema], ...annotations } as any
617 }
618 return { ...jsonSchema, ...annotations }
619}
620
621function getIdentifierAnnotation(ast: AST.AST): string | undefined {
622 const identifier = Option.getOrUndefined(AST.getJSONIdentifier(ast))

Callers 2

addASTAnnotationsFunction · 0.85
goFunction · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected