decline-ts
Version:
Composable command-line parser for TypeScript - a (partial) porting of Scala decline using fp-ts
28 lines (27 loc) • 908 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.Many = void 0;
var Many;
(function (Many) {
/**
* Constructors
*/
Many.just = (value) => ({ _tag: 'Just', value });
Many.prod = (...allOf) => ({ _tag: 'Prod', allOf });
Many.sum = (...anyOf) => ({ _tag: 'Sum', anyOf });
/**
* Methods
*/
Many.asProd = (many) => Many.prod(many);
Many.asSum = (many) => Many.sum(many);
Many.isJust = (many) => many._tag === 'Just';
Many.isProd = (many) => many._tag === 'Prod';
let Prod;
(function (Prod) {
Prod.and = (other) => (p) => Many.prod(...p.allOf, ...other.allOf);
})(Prod = Many.Prod || (Many.Prod = {}));
let Sum;
(function (Sum) {
Sum.or = (other) => (s) => Many.sum(...s.anyOf, ...other.anyOf);
})(Sum = Many.Sum || (Many.Sum = {}));
})(Many = exports.Many || (exports.Many = {}));