@augment-vir/assert
Version:
A collection of assertions for test and production code alike.
29 lines (28 loc) • 1.1 kB
TypeScript
import { type AnyFunction, type ArrayElement } from '@augment-vir/core';
import { type UnionToIntersection } from 'type-fest';
import { guardOverrides } from '../../assertions/extendable-assertions.js';
declare const checkMethods: UnionToIntersection<ArrayElement<typeof guardOverrides>['check']>;
/**
* A group of guard methods that return a boolean type guard rather than an assertion type guard.
*
* This can also be called as a standalone check function which returns a boolean to indicate
* whether its input is truthy or not.
*
* @category Assert
* @category Package : @augment-vir/assert
* @example
*
* ```ts
* import {check} from '@augment-vir/assert';
*
* const value: unknown = 'some value' as unknown;
* if (check.isString(value)) {
* // `value` will now be typed as a `string` in here
* }
* ```
*
* @returns A boolean (as a type guard when possible).
* @package [`@augment-vir/assert`](https://www.npmjs.com/package/@augment-vir/assert)
*/
export declare const check: ((input: unknown) => boolean) & typeof checkMethods & Record<keyof AnyFunction, never>;
export {};