type-fns
Version:
A set of types, type checks, and type guards for simpler, safer, and easier to read code.
16 lines • 458 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.withNot = void 0;
/**
* a wrapper that enables you to easily negate the result of a type check function
*
* for example:
* ```ts
* const withoutIds = objects.filter(withNot(hasUuid));
*
* const invalidOptions = objects.filter(withNot(isOfStatus));
* ```
*/
const withNot = (is) => (args) => !is(args);
exports.withNot = withNot;
//# sourceMappingURL=withNot.js.map