@typed/io
Version:
Runtime IO type system
11 lines • 419 B
JavaScript
import { isMap } from '@typed/logic';
import { array } from './Array';
import { Guard } from './Guard';
import { refinement } from './refinement';
export const Map = Guard.is(isMap);
export const map = (key, value) => {
const keys = array(key);
const values = array(value);
return refinement(Map, (m) => keys.is(Array.from(m.keys())) && values.is(Array.from(m.values())));
};
//# sourceMappingURL=Map.js.map