-
Notifications
You must be signed in to change notification settings - Fork 7.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Improves types for registerPlugin and getPlugin (#8058)
* fix: improves types for registerPlugin and getPlugin * fix: corrects parameter type for registerPlugin * docs(fix): add support for {typeof class} expression * chore: move js-doc-typeof-plugin to build dir
- Loading branch information
1 parent
509b3d0
commit 2e96253
Showing
3 changed files
with
17 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* The jsdoc plugin that will convert types like {typeof ClassName} into {Class<ClassName>} | ||
*/ | ||
exports.handlers = { | ||
jsdocCommentFound: event => { | ||
event.comment = (event.comment || '').replace(/\{.*typeof\s+([^\s\|]+).*\}/g, typeExpression => { | ||
return typeExpression.replace(/typeof\s+([^\s\|\}]+)/g, (expression, className) => { | ||
return 'Class<' + className + '>'; | ||
}); | ||
}); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters