main
Last change
on this file since d565449 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
|
Rev | Line | |
---|
[d565449] | 1 | "use strict";
|
---|
| 2 |
|
---|
| 3 | Object.defineProperty(exports, "__esModule", {
|
---|
| 4 | value: true
|
---|
| 5 | });
|
---|
| 6 | exports.prettifyTargets = prettifyTargets;
|
---|
| 7 | exports.prettifyVersion = prettifyVersion;
|
---|
| 8 | var _semver = require("semver");
|
---|
| 9 | var _targets = require("./targets.js");
|
---|
| 10 | function 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 | }
|
---|
| 28 | function 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.