mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
fix types of filter function arguments
This commit is contained in:
parent
3a69de74e2
commit
02ca5e8e4e
4
types/mathjs/index.d.ts
vendored
4
types/mathjs/index.d.ts
vendored
@ -1299,8 +1299,8 @@ declare namespace math {
|
||||
* traversed. The function must return a boolean.
|
||||
*/
|
||||
filter(
|
||||
x: Matrix | MathArray,
|
||||
test: ((value: any, index: any, matrix: Matrix | MathArray) => Matrix | MathArray) | RegExp
|
||||
x: Matrix | MathArray | string[],
|
||||
test: ((value: any, index: any, matrix: Matrix | MathArray | string[]) => boolean) | RegExp
|
||||
): Matrix | MathArray;
|
||||
|
||||
/**
|
||||
|
||||
@ -281,6 +281,12 @@ Matrices examples
|
||||
return value * value;
|
||||
}); // returns [1, 4, 9]
|
||||
}
|
||||
|
||||
// filter matrix
|
||||
{
|
||||
math.filter([6, -2, -1, 4, 3], function(x) { return x > 0; }); // returns [6, 4, 3]
|
||||
math.filter(["23", "foo", "100", "55", "bar"], /[0-9]+/); // returns ["23", "100", "55"]
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user