Skip to content

Commit

Permalink
fix(docs): Add workaround for ErrorMetadata typedef (#8737)
Browse files Browse the repository at this point in the history
  • Loading branch information
mister-ben authored May 23, 2024
1 parent 35de64c commit 4de09e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions .jsdoc.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
plugins: [
'plugins/markdown',
'build/jsdoc-typeof-plugin',
'build/jsdoc-workarounds',
],
markdown: {
tags: ['example'],
Expand Down
13 changes: 13 additions & 0 deletions build/jsdoc-workarounds.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* This jsdoc plugin works around some typescript-flavoured jsdoc that isn't actual jsdoc,
* so docs:api doesn't fail
*/
exports.handlers = {
jsdocCommentFound: event => {
// Special case for media-error.js
event.comment = (event.comment || '').replace(
'@typedef {{errorType: string, [key: string]: any}} ErrorMetadata',
'@typedef {Object} ErrorMetadata\n * @property {string} errorType Error type'
);
}
};

0 comments on commit 4de09e4

Please sign in to comment.