本文整理汇总了TypeScript中semver.rcompare函数的典型用法代码示例。如果您正苦于以下问题:TypeScript rcompare函数的具体用法?TypeScript rcompare怎么用?TypeScript rcompare使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了rcompare函数的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
strn = semver.inc(str, "prerelease", loose, "alpha");
num = semver.major(str, loose);
num = semver.minor(str, loose);
num = semver.patch(str, loose);
strArr = semver.prerelease(str, loose);
// Comparison
bool = semver.gt(v1, v2, loose);
bool = semver.gte(v1, v2, loose);
bool = semver.lt(v1, v2, loose);
bool = semver.lte(v1, v2, loose);
bool = semver.eq(v1, v2, loose);
bool = semver.neq(v1, v2, loose);
bool = semver.cmp(v1, op, v2, loose);
comparatorResult = semver.compare(v1, v2, loose);
comparatorResult = semver.rcompare(v1, v2, loose);
comparatorResult = semver.compareIdentifiers(str, str);
comparatorResult = semver.rcompareIdentifiers(str, str);
versionsArr = semver.sort(['', new semver.SemVer('')]);
versionsArr = semver.rsort(['', new semver.SemVer('')]);
diff = semver.diff(v1, v2, loose);
// Ranges
str = semver.validRange(str, loose);
bool = semver.satisfies(version, str, loose);
str = semver.maxSatisfying(versions, str, loose);
str = semver.minSatisfying(versions, str, loose);
bool = semver.gtr(version, str, loose);
bool = semver.ltr(version, str, loose);
bool = semver.outside(version, str, '<', loose);
bool = semver.intersects(str, str, loose);
示例2: sortByVersion
function sortByVersion(browserA: Browser, browserB: Browser): number {
return rcompare(
convertToValidSemver(browserA.version),
convertToValidSemver(browserB.version)
);
}
示例3:
return pluginsById.map(p => p.sort((a, b) => semver.rcompare(a.version, b.version))[0]);
示例4:
.sort((a, b) => semver.rcompare(a.version, b.version))
示例5:
str = semver.inc(str, str, loose);
num = semver.major(str, loose);
num = semver.minor(str, loose);
num = semver.patch(str, loose);
strArr = semver.prerelease(str, loose);
// Comparison
bool = semver.gt(v1, v2, loose);
bool = semver.gte(v1, v2, loose);
bool = semver.lt(v1, v2, loose);
bool = semver.lte(v1, v2, loose);
bool = semver.eq(v1, v2, loose);
bool = semver.neq(v1, v2, loose);
bool = semver.cmp(v1, x, v2, loose);
num = semver.compare(v1, v2, loose);
num = semver.rcompare(v1, v2, loose);
diff = semver.diff(v1, v2, loose);
// Ranges
str = semver.validRange(str, loose);
bool = semver.satisfies(version, str, loose);
str = semver.maxSatisfying(versions, str, loose);
str = semver.minSatisfying(versions, str, loose);
bool = semver.gtr(version, str, loose);
bool = semver.ltr(version, str, loose);
bool = semver.outside(version, str, str, loose);
var ver = new semver.SemVer(str, bool);
str = ver.raw;
bool = ver.loose;
str = ver.format();
示例6:
.sort((a: FormattedPackageVersion, b: FormattedPackageVersion) =>
// @ts-ignore
semver.rcompare(a.display, b.display)