type-fns
Version:
A set of types, type checks, and type guards for simpler, safer, and easier to read code.
21 lines • 813 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isPresent = void 0;
const withAssure_1 = require("../wrappers/withAssure");
const isNotNull_1 = require("./isNotNull");
const isNotUndefined_1 = require("./isNotUndefined");
const assess = (t) => (0, isNotNull_1.isNotNull)(t) && (0, isNotUndefined_1.isDefined)(t);
const assure = (0, withAssure_1.asAssure)(assess, { name: 'isPresent' });
/**
* checks whether the value is defined and is not null
*
* refs
* - https://github.com/microsoft/TypeScript/issues/16069#issuecomment-566222173
*/
const isPresentWithAssure = function (...input) {
return assess(...input);
};
exports.isPresent = isPresentWithAssure;
isPresentWithAssure.assess = assess;
isPresentWithAssure.assure = assure;
//# sourceMappingURL=isPresent.js.map