Make ramda typings tests pass strict null checks

This commit is contained in:
Marcin Biernat
2018-02-08 15:34:51 +01:00
parent 9a5b1dbfe0
commit 80c8b9cc63
3 changed files with 6 additions and 6 deletions
+2 -2
View File
@@ -201,8 +201,8 @@ declare namespace R {
* A function that returns the first argument if it's falsy otherwise the second argument. Note that this is
* NOT short-circuited, meaning that if expressions are passed they are both evaluated.
*/
and<T extends { and?: ((...a: any[]) => any); } | number | boolean | string>(fn1: T, val2: any): boolean;
and<T extends { and?: ((...a: any[]) => any); } | number | boolean | string>(fn1: T): (val2: any) => boolean;
and<T extends { and?: ((...a: any[]) => any); } | number | boolean | string | null>(fn1: T, val2: any): boolean;
and<T extends { and?: ((...a: any[]) => any); } | number | boolean | string | null>(fn1: T): (val2: any) => boolean;
/**
* Returns true if at least one of elements of the list match the predicate, false otherwise.
+2 -2
View File
@@ -415,7 +415,7 @@ R.times(i, 5);
*/
() => {
function mergeThree(a: number, b: number, c: number): number[] {
return ([]).concat(a, b, c);
return (new Array<number>()).concat(a, b, c);
}
mergeThree(1, 2, 3); // => [1, 2, 3]
@@ -2314,7 +2314,7 @@ class Why {
const x0: boolean = R.or(false, true); // => false
const x1: number | any[] = R.or(0, []); // => []
const x2: number | any[] = R.or(0)([]); // => []
const x3: string = R.or(null, ""); // => ''
const x3: string | null = R.or(null, ""); // => ''
const why = new Why(true);
why.or(true);
+2 -2
View File
@@ -7,7 +7,7 @@
],
"noImplicitAny": true,
"noImplicitThis": false,
"strictNullChecks": false,
"strictNullChecks": true,
"strictFunctionTypes": false,
"baseUrl": "../",
"typeRoots": [
@@ -22,4 +22,4 @@
"index.d.ts",
"ramda-tests.ts"
]
}
}