(ast._tag)
| 15095 | |
| 15096 | function toCodecIsoASTStep(ast: SchemaAST.AST, recur: (ast: SchemaAST.AST) => SchemaAST.AST): SchemaAST.AST { |
| 15097 | switch (ast._tag) { |
| 15098 | case "Declaration": { |
| 15099 | const getLink = ast.annotations?.toCodecIso ?? ast.annotations?.toCodec |
| 15100 | if (Predicate.isFunction(getLink)) { |
| 15101 | const link = getLink(ast.typeParameters.map((tp) => InternalSchema.make(tp))) |
| 15102 | return SchemaAST.replaceEncoding(ast, [SchemaAST.mapLink(link, recur)]) |
| 15103 | } |
| 15104 | return ast |
| 15105 | } |
| 15106 | case "Arrays": |
| 15107 | case "Objects": |
| 15108 | case "Union": |
| 15109 | case "Suspend": |
| 15110 | return ast.recur(recur) |
| 15111 | } |
| 15112 | return ast |
| 15113 | } |
| 15114 |
no test coverage detected