Effect CommunityEC
Effect Community2y ago
18 replies
Sly

Matching Inputs and Outputs with Schema

How would I match inputs and outputs via Schema? Given I've got basically defined strings that may be put in, each with a specific return type, such as:
input: "test1", outputType: "string"
input: "test2", outputType: "boolean"
Input: "test3", outputType: "number"
input: "test4", outputType: "string"

Is there a senseful way to type this, or should I rather resort to a simple union?
Was this page helpful?