UNPKG

pure-parse

Version:

Strongly typed validation library that decouples type aliases from validation logic

2 lines (1 loc) 209 B
import{success as t,failure as n}from"./ParseResult.js";const c=(...r)=>s=>{for(const o of r){const e=o(s);if(e.tag==="success")return t(e.value)}return n("The value is not in the union")};export{c as oneOf};