本文整理匯總了TypeScript中compare-versions類的典型用法代碼示例。如果您正苦於以下問題:TypeScript compare-versions類的具體用法?TypeScript compare-versions怎麽用?TypeScript compare-versions使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了compare-versions類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: compareVersions
fs.readFile(languageServerArtifactFile, (err, data) => {
if (err) throw err
else {
const languageServerArtifact = data.toString().trim()
const languageServerVersion = languageServerArtifact.split(":")[2]
const isOldServer = compareVersions(languageServerVersion, "0.9.x") <= 0
fetchWithCoursier(coursierPath, languageServerArtifact).then((languageServerClasspath) => {
run({
command: "java",
args: ["-classpath", languageServerClasspath, "dotty.tools.languageserver.Main", "-stdio"]
}, isOldServer)
})
}
})
示例2: compareVersions
(a, b) =>
compareVersions(ts.versionMajorMinor, b) < 0 &&
compareVersions(a, b) <= 0
? b
: a,