(ast: SchemaAST.AST)
| 993 | } |
| 994 | |
| 995 | function streamDataAst(ast: SchemaAST.AST) { |
| 996 | if (!SchemaAST.isObjects(ast)) throw new GenerationError({ reason: "Invalid SSE data schema" }) |
| 997 | const data = ast.propertySignatures.find((field) => field.name === "data")?.type |
| 998 | if (data === undefined) throw new GenerationError({ reason: "Invalid SSE data schema" }) |
| 999 | return data |
| 1000 | } |
| 1001 | |
| 1002 | function streamEffectPortable(schema: Schema.Top) { |
| 1003 | if (!isStreamSchema(schema) || schema._tag === "StreamUint8Array" || schema.sseMode === "events") return true |
no test coverage detected