( ast: AST.AST )
| 1247 | * @category Utilities |
| 1248 | */ |
| 1249 | export const getDescriptionFromSchemaAst = ( |
| 1250 | ast: AST.AST |
| 1251 | ): string | undefined => { |
| 1252 | const annotations = ast._tag === "Transformation" |
| 1253 | ? { |
| 1254 | ...ast.to.annotations, |
| 1255 | ...ast.annotations |
| 1256 | } |
| 1257 | : ast.annotations |
| 1258 | return AST.DescriptionAnnotationId in annotations |
| 1259 | ? (annotations[AST.DescriptionAnnotationId] as string) |
| 1260 | : undefined |
| 1261 | } |
| 1262 | |
| 1263 | /** |
| 1264 | * Generates a JSON Schema for a tool. |