-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue
Milestone
Description
I made function SortFilter like this
/**
* @param {T[]} arr
* @template T
*/
function ItIs(arr) // for test
{
return arr;
}
/**
* @param {T[]} arr
* @param {function(T):number} valuator
* @template T
*/
function SortFilter(arr,valuator)
{
return arr.map((item) => {
return { item: item,value: valuator(item) };
}).filter((pair) => Number.isFinite(pair.value)).sort((l,r) => {
return l.value - r.value;
}).map((pair) => pair.item);
}
And this is the result
As you could see. It seem like it only parse correctly when param is normal array. And fail with callback function as param
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue