1
0
mirror of https://github.com/videojs/video.js.git synced 2024-12-23 02:04:34 +02:00
video.js/build/jsdoc-typeof-plugin.js

13 lines
414 B
JavaScript
Raw Normal View History

/**
* 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 + '>';
});
});
}
};