mirror of
https://github.com/videojs/video.js.git
synced 2024-12-23 02:04:34 +02:00
2e96253632
* 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
13 lines
414 B
JavaScript
13 lines
414 B
JavaScript
/**
|
|
* 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 + '>';
|
|
});
|
|
});
|
|
}
|
|
};
|