typedash
Version:
modern, type-safe collection of utility functions
19 lines (16 loc) • 499 B
JavaScript
;
// src/functions/createTypeGuard/createTypeGuard.ts
function createTypeGuard(values) {
const setValues = new Set(values);
return function predicate(v) {
return setValues.has(v);
};
}
// src/functions/without/without.ts
function without(array, itemsToExclude) {
const isItemToExclude = createTypeGuard(itemsToExclude);
return array.filter((item) => !isItemToExclude(item));
}
exports.without = without;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=index.cjs.map