source: imaps-frontend/node_modules/@babel/helper-compilation-targets/lib/pretty.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 953 bytes
Line 
1"use strict";
2
3Object.defineProperty(exports, "__esModule", {
4 value: true
5});
6exports.prettifyTargets = prettifyTargets;
7exports.prettifyVersion = prettifyVersion;
8var _semver = require("semver");
9var _targets = require("./targets.js");
10function prettifyVersion(version) {
11 if (typeof version !== "string") {
12 return version;
13 }
14 const {
15 major,
16 minor,
17 patch
18 } = _semver.parse(version);
19 const parts = [major];
20 if (minor || patch) {
21 parts.push(minor);
22 }
23 if (patch) {
24 parts.push(patch);
25 }
26 return parts.join(".");
27}
28function prettifyTargets(targets) {
29 return Object.keys(targets).reduce((results, target) => {
30 let value = targets[target];
31 const unreleasedLabel = _targets.unreleasedLabels[target];
32 if (typeof value === "string" && unreleasedLabel !== value) {
33 value = prettifyVersion(value);
34 }
35 results[target] = value;
36 return results;
37 }, {});
38}
39
40//# sourceMappingURL=pretty.js.map
Note: See TracBrowser for help on using the repository browser.