当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript semver.rcompare函数代码示例

本文整理汇总了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);
开发者ID:PriceSpider-NeuIntel,项目名称:DefinitelyTyped,代码行数:31,代码来源:semver-tests.ts

示例2: sortByVersion

function sortByVersion(browserA: Browser, browserB: Browser): number {
  return rcompare(
    convertToValidSemver(browserA.version),
    convertToValidSemver(browserB.version)
  );
}
开发者ID:otbe,项目名称:ws,代码行数:6,代码来源:get-browsers.ts

示例3:

					return pluginsById.map(p => p.sort((a, b) => semver.rcompare(a.version, b.version))[0]);
开发者ID:amamut,项目名称:vscode,代码行数:1,代码来源:extensionPoints.ts

示例4:

 .sort((a, b) => semver.rcompare(a.version, b.version))
开发者ID:electron-userland,项目名称:electron-builder,代码行数:1,代码来源:GitHubProvider.ts

示例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();
开发者ID:Kroisse,项目名称:DefinitelyTyped,代码行数:31,代码来源:semver-tests.ts

示例6:

 .sort((a: FormattedPackageVersion, b: FormattedPackageVersion) =>
   // @ts-ignore
   semver.rcompare(a.display, b.display)
开发者ID:dcos,项目名称:dcos-ui,代码行数:3,代码来源:index.ts


注:本文中的semver.rcompare函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。