perlica
Version:
<h1 align="center">Perlica</h1>
135 lines (134 loc) • 3.75 kB
TypeScript
import * as P from ".";
/**
* Returns `true` if `value > 0`, otherwise returns `false`.
*
* @category Predicate
* @example
* import { isPositive } from "perlica/Predicate/BigInt"
*
* expect(isPositive(0n)).toBeFalse();
* expect(isPositive(4n)).toBeTrue();
* expect(isPositive(-4n)).toBeFalse();
*/
export declare const isPositive: P.Predicate<bigint>;
/**
* Returns `true` if `value >= 0`, otherwise returns `false`.
*
* @category Predicate
* @example
* import { isNonNegative } from "perlica/Predicate/BigInt"
*
* expect(isNonNegative(0n)).toBeTrue();
* expect(isNonNegative(4n)).toBeTrue();
* expect(isNonNegative(-4n)).toBeFalse();
*/
export declare const isNonNegative: P.Predicate<bigint>;
/**
* Returns `true` if `value < 0`, otherwise returns `false`.
*
* @category Predicate
* @example
* import { isNegative } from "perlica/Predicate/BigInt"
*
* expect(isNegative(0n)).toBeFalse();
* expect(isNegative(4n)).toBeFalse();
* expect(isNegative(-4n)).toBeTrue();
*/
export declare const isNegative: P.Predicate<bigint>;
/**
* Returns `true` if `value <= 0`, otherwise returns `false`.
*
* @category Predicate
* @example
* import { isNonPositive } from "perlica/Predicate/BigInt"
*
* expect(isNonPositive(0n)).toBeTrue();
* expect(isNonPositive(4n)).toBeFalse();
* expect(isNonPositive(-4n)).toBeTrue();
*/
export declare const isNonPositive: P.Predicate<bigint>;
/**
* Returns a new `Predicate<T>`.
* Returns `true` if `value` is evenly divisible by a pre-defined `that`.
*
* @category Predicate
* @example
* import { multipleOf } from "perlica/Predicate/BigInt"
*
* const predicate = multipleOf(2n);
*
* expect(predicate(4n)).toBeTrue();
* expect(predicate(3n)).toBeFalse();
*/
export declare const multipleOf: (that: bigint) => P.Predicate<bigint>;
/**
* Returns a new `Predicate<T>`.
* Returns `true` if `that` is less than a pre-defined `value`.
*
* @category Predicate
* @example
* import { lt } from "perlica/Predicate/BigInt"
*
* const predicate = lt(4n);
*
* expect(predicate(5n)).toBeFalse();
* expect(predicate(4n)).toBeFalse();
* expect(predicate(3n)).toBeTrue();
*/
export declare const lt: (that: bigint) => P.Predicate<bigint>;
/**
* Returns a new `Predicate<T>`.
* Returns `true` if `that` is greater than a pre-defined `value`.
*
* @category Predicate
* @example
* import { gt } from "perlica/Predicate/BigInt"
*
* const predicate = gt(4n);
*
* expect(predicate(5n)).toBeTrue();
* expect(predicate(4n)).toBeFalse();
* expect(predicate(3n)).toBeFalse();
*/
export declare const gt: (that: bigint) => P.Predicate<bigint>;
/**
* Returns a new `Predicate<T>`.
* Returns `true` if `that` is less than or equal to a pre-defined `value`.
*
* @category Predicate
* @example
* import { le } from "perlica/Predicate/BigInt"
*
* const predicate = le(4n);
*
* expect(predicate(5n)).toBeFalse();
* expect(predicate(4n)).toBeTrue();
* expect(predicate(3n)).toBeTrue();
*/
export declare const le: (that: bigint) => P.Predicate<bigint>;
/**
* Returns a new `Predicate<T>`.
* Returns `true` if `that` is greater than or equal to a pre-defined `value`.
*
* @category Predicate
* @example
* import { ge } from "perlica/Predicate/BigInt"
*
* const predicate = ge(4n);
*
* expect(predicate(5n)).toBeTrue();
* expect(predicate(4n)).toBeTrue();
* expect(predicate(3n)).toBeFalse();
*/
export declare const ge: (that: bigint) => P.Predicate<bigint>;
/**
* Returns `true` if `value` is `bigint`, otherwise returns `false`.
*
* @category Guard
* @example
* import { isBigInt } from "perlica/Predicate/BigInt"
*
* expect(isBigInt(4n)).toBeFalse();
* expect(isBigInt(4n)).toBeTrue();
*/
export declare const isBigInt: P.Guard<unknown, bigint>;