Browse Source

Update dependencies

master
Sindre Sorhus 6 years ago
parent
commit
e450e4fc47
  1. 6
      package.json
  2. 54
      source/index.ts

6
package.json

@ -17,7 +17,7 @@
"prepublishOnly": "npm run build",
"pretest": "npm run compile -- --sourceMap",
"test": "npm run lint && nyc ava dist/test",
"lint": "tslint --format stylish --project .",
"lint": "tslint --fix --format stylish --project .",
"build": "npm run clean && webpack",
"compile": "npm run clean && tsc",
"clean": "del dist",
@ -47,7 +47,7 @@
"object"
],
"devDependencies": {
"@sindresorhus/is": "^0.12.0",
"@sindresorhus/is": "^0.13.0",
"@types/dot-prop": "^4.2.0",
"@types/lodash.isequal": "^4.5.2",
"@types/node": "^10.12.0",
@ -62,7 +62,7 @@
"lodash.isequal": "^4.5.0",
"nyc": "^13.1.0",
"tslint": "^5.9.1",
"tslint-xo": "^0.9.0",
"tslint-xo": "^0.10.0",
"typedoc": "^0.13.0",
"typescript": "^3.1.3",
"vali-date": "^1.0.0",

54
source/index.ts

@ -23,33 +23,6 @@ export interface Ow {
* @param predicate Predicate to test against.
*/
<T>(value: T, predicate: BasePredicate<T>): void;
/**
* Returns `true` if the value matches the predicate, otherwise returns `false`.
*
* @param value Value to test.
* @param predicate Predicate to test against.
*/
isValid<T>(value: T, predicate: BasePredicate<T>): value is T;
/**
* Create a reusable validator.
*
* @param predicate Predicate used in the validator function.
*/
create<T>(predicate: BasePredicate<T>): (value: T) => void;
/**
* Test that the value matches at least one of the given predicates.
*/
any<T1>(p1: BasePredicate<T1>): AnyPredicate<T1>;
any<T1, T2>(p1: BasePredicate<T1>, p2: BasePredicate<T2>): AnyPredicate<T1 | T2>;
any<T1, T2, T3>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>): AnyPredicate<T1 | T2 | T3>;
any<T1, T2, T3, T4>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>): AnyPredicate<T1 | T2 | T3 | T4>;
any<T1, T2, T3, T4, T5>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>): AnyPredicate<T1 | T2 | T3 | T4 | T5>;
any<T1, T2, T3, T4, T5, T6>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6>;
any<T1, T2, T3, T4, T5, T6, T7>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7>;
any<T1, T2, T3, T4, T5, T6, T7, T8>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8>;
any<T1, T2, T3, T4, T5, T6, T7, T8, T9>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>, p9: BasePredicate<T9>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;
any<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>, p9: BasePredicate<T9>, p10: BasePredicate<T10>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10>;
any(...predicate: BasePredicate[]): AnyPredicate;
/**
* Test the value to be a string.
*/
@ -182,6 +155,33 @@ export interface Ow {
* Test the value to be Iterable.
*/
readonly iterable: Predicate<Iterable<any>>;
/**
* Returns `true` if the value matches the predicate, otherwise returns `false`.
*
* @param value Value to test.
* @param predicate Predicate to test against.
*/
isValid<T>(value: T, predicate: BasePredicate<T>): value is T;
/**
* Create a reusable validator.
*
* @param predicate Predicate used in the validator function.
*/
create<T>(predicate: BasePredicate<T>): (value: T) => void;
/**
* Test that the value matches at least one of the given predicates.
*/
any<T1>(p1: BasePredicate<T1>): AnyPredicate<T1>;
any<T1, T2>(p1: BasePredicate<T1>, p2: BasePredicate<T2>): AnyPredicate<T1 | T2>;
any<T1, T2, T3>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>): AnyPredicate<T1 | T2 | T3>;
any<T1, T2, T3, T4>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>): AnyPredicate<T1 | T2 | T3 | T4>;
any<T1, T2, T3, T4, T5>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>): AnyPredicate<T1 | T2 | T3 | T4 | T5>;
any<T1, T2, T3, T4, T5, T6>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6>;
any<T1, T2, T3, T4, T5, T6, T7>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7>;
any<T1, T2, T3, T4, T5, T6, T7, T8>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8>;
any<T1, T2, T3, T4, T5, T6, T7, T8, T9>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>, p9: BasePredicate<T9>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9>;
any<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(p1: BasePredicate<T1>, p2: BasePredicate<T2>, p3: BasePredicate<T3>, p4: BasePredicate<T4>, p5: BasePredicate<T5>, p6: BasePredicate<T6>, p7: BasePredicate<T7>, p8: BasePredicate<T8>, p9: BasePredicate<T9>, p10: BasePredicate<T10>): AnyPredicate<T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9 | T10>;
any(...predicate: BasePredicate[]): AnyPredicate;
}
const main = <T>(value: T, predicate: BasePredicate<T>) => (predicate as any)[testSymbol](value, main);

Loading…
Cancel
Save