forked from angular/angular-cli
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathplatform-checker.js
35 lines (27 loc) · 925 Bytes
/
platform-checker.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
'use strict';
var semver = require('semver');
var debug = require('debug')('ember-cli:platform-checker:');
var LOWER_RANGE = '0.12.0';
var UPPER_RANGE = '6.0.0';
module.exports = PlatformChecker;
function PlatformChecker(version) {
this.version = version;
this.isValid = this.checkIsValid();
this.isUntested = this.checkIsUntested();
this.isDeprecated = this.checkIsDeprecated();
debug('%o', {
version: this.version,
isValid: this.isValid,
isUntested: this.isUntested,
isDeprecated: this.isDeprecated
});
}
PlatformChecker.prototype.checkIsValid = function() {
return semver.satisfies(this.version, '>=' + LOWER_RANGE + ' <' + UPPER_RANGE);
};
PlatformChecker.prototype.checkIsDeprecated = function() {
return semver.satisfies(this.version, '<' + LOWER_RANGE);
};
PlatformChecker.prototype.checkIsUntested = function() {
return semver.satisfies(this.version, '>=' + UPPER_RANGE);
};