Relative Content

Tag Archive for javascriptvisual-studio-codejsdoc

Dynamic return type based on param value JSDoc

I’ve been trying to document my JS code with types, but am having trouble with this one function. I’m trying to filter an array using its type property, however when trying to map the provided string parameter to type using the typedef-ed object Filter, the return type is a union type (CardItem | StickyNoteItem)[] whereas I expected it to be CardItem[].