-
Notifications
You must be signed in to change notification settings - Fork 653
Description
Background
There are several inconsistencies in the semver mod:
File names and exported functions
The semver mod is not well structured. The file names and functions are not consistent. range_format.ts
and comparator_format.ts
uses [*_verb].ts
and *Format()
, but parse_range.ts
and parse_comparator.ts
uses [verb_*].ts
and parse*()
.
Another inconsistency is: parse_comparator.ts
and parse_range.ts
but is_semver_comparator.ts
and is_semver_range.ts
. The _semver
in the name seems obsolete.
eq, neq, gt, gte, lt, lte
These functuons are wrapper functions for compare()
compare the result to 0 with different comparators:
return compare(s0, s1) [===|!==|>|>=|<|<=] 0
. These seem too trivial.
rcompare
This function calls compare()
with switched arguments. This seems too trivial.
Proposal
File names and exported functions
Rename [*_verb].ts
to [verb_*].ts
and *Format()
to format*()
for all filenames and functions and deprecate old functions and remove _semver
from file names and function:
-
rangeFormat()
=>formatRange()
deprecation(semver): renamerangeFormat()
toformatRange()
#4090 -
deprecatedcomparatorFormat()
=>formatComparator()
-
isSemVerComparator()
=>isComparator()
deprecation(semver): renameisSemVerComparator()
#3957 -
isSemVerRange()
=>isRange()
deprecation(semver): deprecateSemVerRange
, introduceRange
#4161 -
testRange()
=>inRange()
orrangeIncludes()
deprecation(semver): renametestRange()
tosatisfies()
#4364
eq, neq, gt, gte, lt, lte
-
deprecate all these functions deprecation(semver): deprecateeq()
,neq()
,lt()
,lte()
,gt()
andgte()
#4048 - rename all these functions deprecation(semver): rename
eq()
,neq()
,lt()
,lte()
,gt()
andgte()
#4083 -
discuss if these functions should be put incompare.ts
rcompare
- deprecate this function deprecation(semver): deprecate
rcompare()
#3958
Others
- investigate
Comparator
necessity Discussion(semver): Necessity ofComparator
#4047 - investigate possible obsolete
OPERATORS
("", "==", "===", "!==") deprecation(semver): deprecate==
,===
,!==
, and""
operators #4271 - investigate deprecate
compareBuild()
deprecation(semver): deprecatecompareBuild()
#4088 - deprecate
outside()
deprecation(semver): deprecateoutside()
#4185