Skip to content

Commit

Permalink
docs: depth flag default value (#8051)
Browse files Browse the repository at this point in the history
documentation of `ls` command specifies that `depth` flag if not set
defaults to `1` but as per code it uses 0 as default value.
https://github.com/npm/cli/blob/dc31c1bdc6658ab69554adcf2988ee99a615c409/lib/commands/ls.js#L113-L116

fixes: #7979
  • Loading branch information
milaninfy authored Jan 21, 2025
1 parent dc31c1b commit e90c6fe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ are same as \`cpu\` field of package.json, which comes from \`process.arch\`.
#### \`depth\`
* Default: \`Infinity\` if \`--all\` is set, otherwise \`1\`
* Default: \`Infinity\` if \`--all\` is set, otherwise \`0\`
* Type: null or Number
The depth to go when recursing packages for \`npm ls\`.
Expand Down
2 changes: 1 addition & 1 deletion workspaces/config/lib/definitions/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ const definitions = {
depth: new Definition('depth', {
default: null,
defaultDescription: `
\`Infinity\` if \`--all\` is set, otherwise \`1\`
\`Infinity\` if \`--all\` is set, otherwise \`0\`
`,
type: [null, Number],
description: `
Expand Down

0 comments on commit e90c6fe

Please sign in to comment.