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

Function getIdentifierAnnotation

packages/effect/src/JSONSchema.ts:621–636  ·  view source on GitHub ↗
(ast: AST.AST)

Source from the content-addressed store, hash-verified

619}
620
621function getIdentifierAnnotation(ast: AST.AST): string | undefined {
622 const identifier = Option.getOrUndefined(AST.getJSONIdentifier(ast))
623 if (identifier === undefined) {
624 if (AST.isSuspend(ast)) {
625 return getIdentifierAnnotation(ast.f())
626 }
627 if (AST.isTransformation(ast) && AST.isTypeLiteral(ast.from) && AST.isDeclaration(ast.to)) {
628 const to = ast.to
629 const surrogate = AST.getSurrogateAnnotation(to)
630 if (Option.isSome(surrogate)) {
631 return getIdentifierAnnotation(to)
632 }
633 }
634 }
635 return identifier
636}
637
638function go(
639 ast: AST.AST,

Callers 4

getJSONIdentifierFunction · 0.85
toStringMethod · 0.85
getExpectedFunction · 0.85
goFunction · 0.85

Calls 1

fMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…