UNPKG

tiny-types

Version:

A tiny library that brings Tiny Types to JavaScript and TypeScript

22 lines 664 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isBoolean = isBoolean; const Predicate_1 = require("./Predicate"); /** * @desc Ensures that the `value` is a {@link Boolean} value. * * @example * import { ensure, isBoolean, TinyType } from 'tiny-types'; * * class MarketingOptIn extends TinyType { * constructor(public readonly value: boolean) { * ensure('MarketingOptIn', value, isBoolean()); * } * } * * @returns {Predicate<boolean>} */ function isBoolean() { return Predicate_1.Predicate.to(`be a boolean value`, (value) => typeof value === 'boolean'); } //# sourceMappingURL=isBoolean.js.map