Skip to content

Typedefinition in function paramaters with different types #70

@wehrstedt

Description

@wehrstedt

You can do something like this:

/**
 * @typedef {string} SomeType
 */

/**
 * @param {SomeType|object} fuu Some string identifier or an object
 * @param {string} fuu.bar Some property of object fuu
 */
function fuuBar(fuu) {
}
*/

This will fail because the plugin tries to create a type alias definition but will reject because properties are defined. The code above should instead create a type definition for the passed object. Both types should be keep in the parameter type.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions