A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/microsoft/TypeScript/issues/11724 below:

template tag jsdoc not evaluated with function callback as parameter · Issue #11724 · microsoft/TypeScript · GitHub

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


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4