(ast: SchemaAST.AST)
| 367 | } |
| 368 | |
| 369 | function parseMeta(ast: SchemaAST.AST): [SchemaAST.SchemaIdAnnotation | undefined, Record<string | symbol, unknown>] { |
| 370 | const jsonSchema = SchemaAST.getJSONSchemaAnnotation(ast).pipe( |
| 371 | Option.filter(Predicate.isReadonlyRecord), |
| 372 | Option.getOrUndefined |
| 373 | ) |
| 374 | const schemaId = Option.getOrElse(SchemaAST.getSchemaIdAnnotation(ast), () => undefined) |
| 375 | const schemaParams = Option.fromNullable(schemaId).pipe( |
| 376 | Option.map((id) => ast.annotations[id]), |
| 377 | Option.filter(Predicate.isReadonlyRecord), |
| 378 | Option.getOrUndefined |
| 379 | ) |
| 380 | return [schemaId, { ...schemaParams, ...jsonSchema }] |
| 381 | } |
| 382 | |
| 383 | /** @internal */ |
| 384 | export const getDescription = wrapGetDescription( |
no test coverage detected