當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。