source: trip-planner-front/node_modules/@babel/helper-compilation-targets/lib/debug.js@ e29cc2e

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
RevLine 
[6a3a178]1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.getInclusionReasons = getInclusionReasons;
7
8var _semver = require("semver");
9
10var _pretty = require("./pretty");
11
12var _utils = require("./utils");
13
14function 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.