Welcome to mirror list, hosted at ThFree Co, Russian Federation.

describe-all.js « config « utils « lib - github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 23a10ae97783cca07bcbda40c3053e7d82eb1fc3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const definitions = require('./definitions.js')
const localeCompare = require('@isaacs/string-locale-compare')('en')
const describeAll = () => {
  // sort not-deprecated ones to the top
  /* istanbul ignore next - typically already sorted in the definitions file,
   * but this is here so that our help doc will stay consistent if we decide
   * to move them around. */
  const sort = ([keya, {deprecated: depa}], [keyb, {deprecated: depb}]) => {
    return depa && !depb ? 1
      : !depa && depb ? -1
      : localeCompare(keya, keyb)
  }
  return Object.entries(definitions).sort(sort)
    .map(([key, def]) => def.describe())
    .join(
      '\n\n<!-- automatically generated, do not edit manually -->\n' +
        '<!-- see lib/utils/config/definitions.js -->\n\n'
    )
}
module.exports = describeAll