-
Notifications
You must be signed in to change notification settings - Fork 1
@142vip.utils.Variable.VipSemver
API 参考 / @142vip/utils / VipSemver
constVipSemver:object
Defined in: packages/utils/src/pkgs/semver.ts:101
参考:https://www.npmjs.com/package/semver
clean: (
version,optionsOrLoose?) =>null|string
Returns cleaned (removed leading/trailing whitespace, remove '=v' prefix) and parsed version, or null if version is invalid.
string
boolean | Options
null | string
compare: (
v1,v2,optionsOrLoose?) =>-1|0|1
Compares two versions excluding build identifiers (the bit after + in the semantic version string).
Sorts in ascending order when passed to Array.sort().
string | SemVer
string | SemVer
boolean | Options
-1 | 0 | 1
-
0ifv1==v2 -
1ifv1is greater -
-1ifv2is greater.
createSemver: (
version,optionsOrLoose?) =>SemVer
支持原生创建Semver实例
string | SemVer
boolean | RangeOptions
SemVer
eq: (
v1,v2,optionsOrLoose?) =>boolean
v1 == v2 This is true if they're logically equivalent, even if they're not the exact same string. You already know how to compare strings.
string | SemVer
string | SemVer
boolean | Options
boolean
getNextVersions: (
currentVersion,preid?) =>null|NextVersion
获取下一个版本
string
string
null | NextVersion
gt: (
v1,v2,optionsOrLoose?) =>boolean
v1 > v2
string | SemVer
string | SemVer
boolean | Options
boolean
inc: {(
version,release,optionsOrLoose?,identifier?):null|string; (version,release,identifier?,identifierBase?):null|string; }
(
version,release,optionsOrLoose?,identifier?):null|string
Return the version incremented by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if it's not valid.
string | SemVer
ReleaseType
boolean | Options
string
null | string
(
version,release,identifier?,identifierBase?):null|string
Return the version incremented by the release type (major, premajor, minor, preminor, patch, prepatch, or prerelease), or null if it's not valid.
string | SemVer
ReleaseType
string
false | IdentifierBase
null | string
isPrereleaseType: (
value) =>boolean
Determines whether the specified value is a pre-release.
ReleaseType
boolean
isReleaseType: (
value) =>boolean
Determines whether the specified value is a valid ReleaseType string.
ReleaseType
boolean
lt: (
v1,v2,optionsOrLoose?) =>boolean
v1 < v2
string | SemVer
string | SemVer
boolean | Options
boolean
originImportSemVer:
__module
parse: (
version,optionsOrLoose?) =>null|SemVer
Return the parsed version as a SemVer object, or null if it's not valid.
undefined | null | string | SemVer
boolean | Options
null | SemVer
prerelease: (
version,optionsOrLoose?) =>null| readonly (string|number)[]
Returns an array of prerelease components, or null if none exist.
string | SemVer
boolean | Options
null | readonly (string | number)[]
satisfies: (
version,range,optionsOrLoose?) =>boolean
Return true if the version satisfies the range.
string | SemVer
string | Range
boolean | RangeOptions
boolean
valid: (
version,optionsOrLoose?) =>null|string
Return the parsed version as a string, or null if it's not valid.
undefined | null | string | SemVer
boolean | Options
null | string
- @142vip/axios
- @142vip/changelog
- @142vip/commit-linter
- @142vip/copyright
- @142vip/data-source
- @142vip/eslint-config
- @142vip/fairy-cli
- @142vip/grpc
- @142vip/nest
- @142vip/nest-redis
- @142vip/nest-typeorm
- @142vip/oauth2.0
- @142vip/open-source
- @142vip/redis
- @142vip/release-version
- @142vip/typeorm
- @142vip/utils