UNPKG

@typed/io

Version:

Runtime IO type system

8 lines 422 B
import { combine } from '@typed/effects'; import { Record } from './Record'; import { refinement } from './refinement'; export const intersection = (decoders) => refinement(Record, function* (r) { const decoded = yield* combine(...decoders.map((d) => d.decode(r))); return decoded.reduce((acc, x) => ({ ...acc, ...x }), {}); }, decoders.map((d) => d.expected).join(' & ')); //# sourceMappingURL=Intersection.js.map