mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 06:47:03 +00:00
Merge pull request #30211 from appleparan/ap/fix-map-callback
[@types/mathjs] Fix wrong return type of callback of map function
This commit is contained in:
Vendored
+1
-1
@@ -1345,7 +1345,7 @@ declare namespace math {
|
||||
* the Matrix/array being traversed.
|
||||
* @returns Transformed map of x
|
||||
*/
|
||||
map(x: Matrix | MathArray, callback: ((value: any, index: any, matrix: Matrix | MathArray) => Matrix | MathArray)): Matrix | MathArray;
|
||||
map(x: Matrix | MathArray, callback: ((value: any, index: any, matrix: Matrix | MathArray) => MathType | string)): Matrix | MathArray;
|
||||
|
||||
/**
|
||||
* Create a matrix filled with ones. The created matrix can have one or
|
||||
|
||||
@@ -270,6 +270,13 @@ Matrices examples
|
||||
math.range('2:-1:-3');
|
||||
math.factorial(math.range('1:6'));
|
||||
}
|
||||
|
||||
// map matrix
|
||||
{
|
||||
math.map([1, 2, 3], function(value) {
|
||||
return value * value;
|
||||
}); // returns [1, 4, 9]
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user