From a5d0b619473c822e8b1a9d2aa9ec14089f8f9185 Mon Sep 17 00:00:00 2001 From: Simon Seyock Date: Fri, 16 Apr 2021 16:13:30 +0200 Subject: [PATCH] Allow options to be generic in jsdoc --- config/jsdoc/plugins/inline-options.cjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/config/jsdoc/plugins/inline-options.cjs b/config/jsdoc/plugins/inline-options.cjs index 61bd7e5990..15d7fdeeb9 100644 --- a/config/jsdoc/plugins/inline-options.cjs +++ b/config/jsdoc/plugins/inline-options.cjs @@ -32,7 +32,11 @@ exports.handlers = { for (let j = 0, jj = params.length; j < jj; ++j) { const param = params[j]; if (param.type && param.type.names) { - const type = param.type.names[0]; + let type = param.type.names[0]; + const genericMatches = type.match(/(^.*?)\.?<.*>/); + if (genericMatches) { + type = genericMatches[1]; + } if (type in properties) { param.type.names[0] = type; params.push.apply(