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