UNPKG

@typed/io

Version:

Runtime IO type system

13 lines 486 B
import * as G from '../guard'; import { array } from './Array'; import { Decoder } from './Decoder'; import { refinement } from './refinement'; const _Set = Decoder.fromGuard(G.Set, `ReadonlySet<unknown>`); export { _Set as Set }; export const set = (d) => { const arrayDecoder = array(d); return refinement(_Set, function* (s) { return new Set(yield* arrayDecoder.decode(Array.from(s.values()))); }, `ReadonlySet<${d.expected}>`); }; //# sourceMappingURL=Set.js.map