Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
onury committed Mar 9, 2017
1 parent 75638b2 commit d627b72
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -407,22 +407,22 @@ module.exports = (function () {
}

/**
* Builds a flat array of symbol names from the given JSDoc-X parsed
* output.
* Builds and gets a flat array of symbol names from the given jsdoc-x
* parsed output.
*
* @param {Array} docs - JSDoc documentation data.
* @param {String|Function} [sortTypeOrSorter]
* @param {String|Function} [sorter]
* Either a comparer function to be used for sorting; or a
* pre-defined string: `"alphabetic"` or `"grouped"`.
*
* @returns {Array} - Array of symbol names.
*/
utils.getSymbolNames = function (docs, sortTypeOrSorter) {
var sorter = typeof sortTypeOrSorter === 'function'
? sortTypeOrSorter
: utils._getSorter(sortTypeOrSorter);
utils.getSymbolNames = function (docs, sorter) {
var sortFn = typeof sorter === 'function'
? sorter
: utils._getSorter(sorter);
var names = _getSymNames(docs);
if (sorter) names.sort(sorter);
if (sortFn) names.sort(sortFn);
return names;
};

Expand Down

0 comments on commit d627b72

Please sign in to comment.