Last change
on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Line | |
---|
1 | "use strict";
|
---|
2 |
|
---|
3 | Object.defineProperty(exports, "__esModule", {
|
---|
4 | value: true
|
---|
5 | });
|
---|
6 | exports.getInclusionReasons = getInclusionReasons;
|
---|
7 |
|
---|
8 | var _semver = require("semver");
|
---|
9 |
|
---|
10 | var _pretty = require("./pretty");
|
---|
11 |
|
---|
12 | var _utils = require("./utils");
|
---|
13 |
|
---|
14 | function getInclusionReasons(item, targetVersions, list) {
|
---|
15 | const minVersions = list[item] || {};
|
---|
16 | return Object.keys(targetVersions).reduce((result, env) => {
|
---|
17 | const minVersion = (0, _utils.getLowestImplementedVersion)(minVersions, env);
|
---|
18 | const targetVersion = targetVersions[env];
|
---|
19 |
|
---|
20 | if (!minVersion) {
|
---|
21 | result[env] = (0, _pretty.prettifyVersion)(targetVersion);
|
---|
22 | } else {
|
---|
23 | const minIsUnreleased = (0, _utils.isUnreleasedVersion)(minVersion, env);
|
---|
24 | const targetIsUnreleased = (0, _utils.isUnreleasedVersion)(targetVersion, env);
|
---|
25 |
|
---|
26 | if (!targetIsUnreleased && (minIsUnreleased || _semver.lt(targetVersion.toString(), (0, _utils.semverify)(minVersion)))) {
|
---|
27 | result[env] = (0, _pretty.prettifyVersion)(targetVersion);
|
---|
28 | }
|
---|
29 | }
|
---|
30 |
|
---|
31 | return result;
|
---|
32 | }, {});
|
---|
33 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.