docusaurus-plugin-typedoc-api
Version:
Docusaurus plugin that provides source code API documentation powered by TypeDoc.
49 lines (46 loc) • 1.45 kB
JavaScript
;
/* eslint-disable no-param-reassign */
// https://github.com/TypeStrong/typedoc/releases/tag/v0.23.0
// https://github.com/milesj/docusaurus-plugin-typedoc-api/pull/50
function migrateToVersion0230(reflection) {
if (Array.isArray(reflection.getSignature)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
reflection.getSignature = reflection.getSignature[0];
}
if (Array.isArray(reflection.setSignature)) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
reflection.setSignature = reflection.setSignature[0];
}
if ('typeParameter' in reflection) {
reflection.typeParameters = reflection.typeParameter;
}
if (reflection.comment && ('shortText' in reflection.comment || 'text' in reflection.comment || 'tags' in reflection.comment)) {
const comment = reflection.comment;
const summary = [];
if (comment.shortText) {
summary.push({
kind: 'text',
text: comment.shortText
});
}
if (comment.text) {
summary.push({
kind: 'text',
text: comment.text
});
}
reflection.comment = {
blockTags: comment.tags?.map(tag => ({
content: [{
kind: 'text',
text: tag.text
}],
name: tag.tag,
tag: `@${tag.tag}`
})),
summary
};
}
}
exports.migrateToVersion0230 = migrateToVersion0230;
//# sourceMappingURL=0.23.js.map