本文整理匯總了TypeScript中app/core/utils/version.SemVersion類的典型用法代碼示例。如果您正苦於以下問題:TypeScript SemVersion類的具體用法?TypeScript SemVersion怎麽用?TypeScript SemVersion使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了SemVersion類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: SemVersion
.then(results => {
if (results.data) {
let semver = new SemVersion(results.data);
return semver.isValid() ? results.data : '';
}
return '';
})
示例2: it
it('should detect greater version properly', () => {
let semver = new SemVersion(version);
let cases = [
{value: '3.4.5', expected: true},
{value: '3.4.4', expected: true},
{value: '3.4.6', expected: false},
{value: '4', expected: false},
{value: '3.5', expected: false},
];
cases.forEach((testCase) => {
expect(semver.isGtOrEq(testCase.value)).to.be(testCase.expected);
});
});
示例3: expect
cases.forEach((testCase) => {
expect(semver.isGtOrEq(testCase.value)).to.be(testCase.expected);
});