tiny-types
Version:
A tiny library that brings Tiny Types to JavaScript and TypeScript
20 lines (19 loc) • 647 B
TypeScript
import { Predicate } from './Predicate';
/**
* @desc Ensures that the `value` is greater than or equal to the `lowerBound` and less than or equal to the `upperBound`
*
* @example
* import { ensure, isInRange, TinyType } from 'tiny-types';
*
* class InvestmentLengthInYears extends TinyType {
* constructor(public readonly value: number) {
* super();
* ensure('InvestmentLengthInYears', value, isInRange(1, 5));
* }
* }
*
* @param {number} lowerBound
* @param {number} upperBound
* @returns {Predicate<number>}
*/
export declare function isInRange(lowerBound: number, upperBound: number): Predicate<number>;