mirror of
https://github.com/documentationjs/documentation.git
synced 2026-01-18 14:17:30 +00:00
* Source-sorting by default Many changes * Uses a new version of module-deps that exposes a sort key we use to sort documentation. * Adds inference for methods in objects * Groups events into a separate comment property * Add jsdoc property. Refs https://github.com/documentationjs/documentation/pull/388#issuecomment-215791547 * Namespaces and paths * More powerful paths: paths now include name, kind, and scope * comments now include a 'namespace' property with a formatted namespace * Fix tests * Re-ignore fonts * Nix sourceKey from output * Pin dependency versions * Fix module-deps-sortable ref * Update tests for right deps
15 lines
402 B
JavaScript
15 lines
402 B
JavaScript
'use strict';
|
|
|
|
/**
|
|
* Sort two documentation objects, given an optional order object. Returns
|
|
* a numeric sorting value that is compatible with stream-sort.
|
|
*
|
|
* @param {Object} a documentation object
|
|
* @param {Object} b documentation object
|
|
* @return {number} sorting value
|
|
* @private
|
|
*/
|
|
module.exports = function sortDocs(a, b) {
|
|
return a.context.sortKey.localeCompare(b.context.sortKey);
|
|
};
|