Skip to content

Commit 1d28d5e

Browse files
authored
docs: fix typos and update -n CLI option documentation (#836)
Small cleanup PR: ## Typo fixes - `internal/re.js`: "numberic" → "numeric" (3 occurrences) - `functions/diff.js`: "preleases" → "prereleases" - `test/ranges/min-version.js`: "Carot" → "Caret" - `ranges/subset.js`: "GT.semver" → "LT.semver" (comment was in the LT section) ## Documentation - Update README `-n` option to match the CLI help text (documents the `false` option to omit the prerelease number)
1 parent 5816d4c commit 1d28d5e

5 files changed

Lines changed: 8 additions & 7 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,9 @@ Options:
110110
-l --loose
111111
Interpret versions and ranges loosely
112112
113-
-n <0|1>
114-
This is the base to be used for the prerelease identifier.
113+
-n <0|1|false>
114+
Base number for prerelease identifier (default: 0).
115+
Use false to omit the number altogether.
115116
116117
-p --include-prerelease
117118
Always include prerelease versions in range matching

functions/diff.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ const diff = (version1, version2) => {
5353
return prefix + 'patch'
5454
}
5555

56-
// high and low are preleases
56+
// high and low are prereleases
5757
return 'prerelease'
5858
}
5959

internal/re.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,8 @@ createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
7878

7979
// ## Pre-release Version Identifier
8080
// A numeric identifier, or a non-numeric identifier.
81-
// Non-numberic identifiers include numberic identifiers but can be longer.
82-
// Therefore non-numberic identifiers must go first.
81+
// Non-numeric identifiers include numeric identifiers but can be longer.
82+
// Therefore non-numeric identifiers must go first.
8383

8484
createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
8585
}|${src[t.NUMERICIDENTIFIER]})`)

ranges/subset.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ const compare = require('../functions/compare.js')
3838
// - If LT
3939
// - If LT.semver is greater than any < or <= comp in C, return false
4040
// - If LT is <=, and LT.semver does not satisfy every C, return false
41-
// - If GT.semver has a prerelease, and not in prerelease mode
41+
// - If LT.semver has a prerelease, and not in prerelease mode
4242
// - If no C has a prerelease and the LT.semver tuple, return false
4343
// - Else return true
4444

test/ranges/min-version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ test('minimum version in range tests', (t) => {
3131
['~1.1.1-beta', '1.1.1-beta'],
3232
['~1.1.1 || >=2', '1.1.1'],
3333

34-
// Carot
34+
// Caret
3535
['^1.1.1', '1.1.1'],
3636
['^1.1.1-beta', '1.1.1-beta'],
3737
['^1.1.1 || >=2', '1.1.1'],

0 commit comments

Comments
 (0)