UNPKG

@lucaspaganini/value-objects

Version:

TypeScript first validation and class creation library

14 lines (13 loc) 448 B
export interface Left<L> { _tag: 'Left'; left: L; } export interface Right<R> { _tag: 'Right'; right: R; } export declare type Either<L, R> = Left<L> | Right<R>; export declare const isLeft: <L, R>(either: Either<L, R>) => either is Left<L>; export declare const isRight: <L, R>(either: Either<L, R>) => either is Right<R>; export declare const left: <L>(value: L) => Left<L>; export declare const right: <R>(value: R) => Right<R>;