Skip to content

Commit

Permalink
API docs fixes, removed the commented-out code.
Browse files Browse the repository at this point in the history
  • Loading branch information
ma2ciek committed Jul 21, 2020
1 parent 1fa6b0e commit 25d8e4f
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 27 deletions.
5 changes: 0 additions & 5 deletions packages/jsdoc-plugins/lib/cleanup.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,6 @@ exports.handlers = {
);
}

// Filter out private doclet classes.
// if ( doclet.kind === 'class' && doclet.access === 'private' ) {
// return false;
// }

return true;
} );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
const assign = Object.assign;

/**
* @param {Array.<Doclet>} doclets
* @param {Array.<Doclet>} doclets
*/
function convertShortRefsToFullRefs( doclets ) {
addMissingModulePart( doclets );
Expand All @@ -18,7 +18,7 @@ function convertShortRefsToFullRefs( doclets ) {
convertShortRefsInLinks( doclets );
}

/** @param {Doclet[]} doclets */
/** @param {Array.<Doclet>} doclets */
function addMissingModulePart( doclets ) {
/** @type {Record<String,Doclet>} */
const fileNameModuleDoclets = {};
Expand Down Expand Up @@ -47,7 +47,7 @@ function addMissingModulePart( doclets ) {
}
}

/** @param {Doclet[]} doclets */
/** @param {Array.<Doclet>} doclets */
function convertShortRefsInLongnameAndMemberof( doclets ) {
const fileDoclets = groupDocletsByFiles( doclets );

Expand Down Expand Up @@ -85,7 +85,7 @@ function convertShortRefsInLongnameAndMemberof( doclets ) {
}
}

/** @param {Doclet[]} doclets */
/** @param {Array.<Doclet>} doclets */
function convertShortRefsInFireTag( doclets ) {
for ( const doclet of doclets ) {
if ( !doclet.fires ) {
Expand All @@ -110,7 +110,7 @@ function convertShortRefsInFireTag( doclets ) {
}
}

/** @param {Doclet[]} doclets */
/** @param {Array.<Doclet>} doclets */
function convertShortRefsInSeeTag( doclets ) {
/** @type {Doclet} */
let lastInterfaceOrClass;
Expand Down Expand Up @@ -185,10 +185,10 @@ function convertShortRefsInLinks( doclets ) {
}

/**
* @param {Doclet[]} doclets
* @param {Array.<Doclet>} doclets
*/
function groupDocletsByFiles( doclets ) {
/** @type {Record.<String,Doclet[]>}*/
/** @type {Record.<String,Array.<Doclet>>}*/
const files = {};

for ( const doclet of doclets ) {
Expand All @@ -205,7 +205,7 @@ function groupDocletsByFiles( doclets ) {
/**
* Finds within the same file the parent doclet (`class`, `interface` or `mixin`).
*
* @param {Doclet[]} fileDoclets
* @param {Array.<Doclet>} fileDoclets
* @param {Doclet} doclet
*/
function getCorrespondingParent( fileDoclets, doclet ) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const { isEqual } = require( 'lodash' );
* JSDoc completely messes up doclets for constructors and classes.
* They are duplicated (where the only one contains valuable data), have invalid descriptions, etc.
*
* @param {Doclet[]} doclets
* @param {Array.<Doclet>} doclets
*/
module.exports = function fixIncorrectClassConstructor( doclets ) {
const knownConstructorDoclets = new Set();
Expand Down Expand Up @@ -64,9 +64,5 @@ module.exports = function fixIncorrectClassConstructor( doclets ) {
}

knownDoclets.set( doclet.longname, doclet );

// if ( doclet.inheritdoc === '' ) {
// doclet.ignore = true;
// }
}
};
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ function extendTypedef( typedef, typedefDoclets ) {
/**
* Creates and returns doclets for `@typedef` properties.
*
* @param {Doclet[]} typedefDoclets
* @param {Array.<Doclet>} typedefDoclets
*/
function createTypedefPropertyDoclets( typedefDoclets ) {
const typedefPropertyDoclets = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,7 @@
* @param {Array.<Doclet>} doclets
*/
module.exports = function filterOutInternalDoclets( doclets ) {
doclets = doclets
return doclets
.filter( doclet => !doclet.ignore )
.filter( doclet => doclet.memberof != '<anonymous>' );

// return filterOutReExportedSymbols( doclets );

return doclets;
};
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ function getDocletsToAdd( docletCollection, childDoclet, options ) {
// Longnames of doclets which are related ( extended, mixed, implemented ) to childDoclet.
const ancestors = childDoclet[ options.relation ] || [];

/** @type {Doclet[]} */
/** @type {Array.<Doclet>} */
const docletsToAdd = [];

for ( const ancestor of ancestors ) {
Expand Down
4 changes: 2 additions & 2 deletions packages/jsdoc-plugins/lib/relation-fixer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ exports.handlers = {
* Revert missing doclets that were marked as ignored.
* Remove ignored doclets.
*
* @param {Doclet[]} doclets
* @param {Array.<Doclet>} doclets
*/
function precleanInheritance( doclets ) {
// Group doclet by longnames
/** @type {Map.<String,Doclet[]>} */
/** @type {Map.<String,Array.<Doclet>>} */
const docletMap = new Map();

for ( const doclet of doclets ) {
Expand Down

0 comments on commit 25d8e4f

Please sign in to comment.