dilswer
Version:
Blazingly fast data validation library with TypeScript integration.
13 lines (12 loc) • 324 B
JavaScript
// src/intrinsic-type-utils/exclude.ts
import { UnionType } from "../data-types/types/union.mjs";
var Exclude = (union, ...excludeTypes) => {
return new UnionType(
union.oneOf.filter(
(t) => !("simpleType" in t) || !excludeTypes.some((exc) => exc.simpleType === t.simpleType)
)
);
};
export {
Exclude
};