mirror of https://github.com/lukechilds/ow.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
442 B
13 lines
442 B
import {testSymbol, BasePredicate} from './predicates/base-predicate';
|
|
|
|
/**
|
|
* Validate the value against the provided predicate.
|
|
*
|
|
* @hidden
|
|
* @param value Value to test.
|
|
* @param label Label which should be used in error messages.
|
|
* @param predicate Predicate to test to value against.
|
|
*/
|
|
export default function test<T>(value: T, label: string | Function, predicate: BasePredicate<T>) {
|
|
predicate[testSymbol](value, test, label);
|
|
}
|
|
|