Skip to content

Commit 4de09e4

Browse files
authored
fix(docs): Add workaround for ErrorMetadata typedef (videojs#8737)
1 parent 35de64c commit 4de09e4

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

.jsdoc.js

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ module.exports = {
6161
plugins: [
6262
'plugins/markdown',
6363
'build/jsdoc-typeof-plugin',
64+
'build/jsdoc-workarounds',
6465
],
6566
markdown: {
6667
tags: ['example'],

build/jsdoc-workarounds.js

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* This jsdoc plugin works around some typescript-flavoured jsdoc that isn't actual jsdoc,
3+
* so docs:api doesn't fail
4+
*/
5+
exports.handlers = {
6+
jsdocCommentFound: event => {
7+
// Special case for media-error.js
8+
event.comment = (event.comment || '').replace(
9+
'@typedef {{errorType: string, [key: string]: any}} ErrorMetadata',
10+
'@typedef {Object} ErrorMetadata\n * @property {string} errorType Error type'
11+
);
12+
}
13+
};

0 commit comments

Comments
 (0)