@typed/io
Version:
Runtime IO type system
21 lines • 670 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.intersection = void 0;
const D = require("../decoder");
const E = require("../encoder");
const G = require("../guard");
const getIntersectionName = (types) => types.map((t) => t.name).join(' & ');
function intersection(types, name = getIntersectionName(types)) {
const guard = G.intersection(types);
const decoder = D.intersection(types);
const encoder = E.intersection(types);
return {
...guard,
...decoder,
...encoder,
name,
members: types,
};
}
exports.intersection = intersection;
//# sourceMappingURL=Intersection.js.map