Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

template tag jsdoc not evaluated with function callback as parameter #11724

Copy link
Copy link
@Thaina

Description

@Thaina
Issue body actions

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

image

image

As you could see. It seem like it only parse correctly when param is normal array. And fail with callback function as param

Reactions are currently unavailable

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.