tiny-types
Version:
A tiny library that brings Tiny Types to JavaScript and TypeScript
20 lines (19 loc) • 486 B
TypeScript
import { Predicate } from './Predicate';
/**
* @desc Ensures that the `value` is an {@link Array}.
*
* @example
* import { ensure, isArray, TinyType, TinyTypeOf } from 'tiny-types';
*
* class Name extends TinyTypeOf<string>() {}
*
* class Names extends TinyType {
* constructor(public readonly values: Name[]) {
* super();
* ensure('Names', values, isArray());
* }
* }
*
* @returns {Predicate<T[]>}
*/
export declare function isArray<T>(): Predicate<T[]>;