Sha256: a4e4c76ff3f7a1a20ae1c4f9d111a40e1d46e8cd02db72e8c76b5fd766bf0f57

Contents?: true

Size: 946 Bytes

Versions: 4

Compression:

Stored size: 946 Bytes

Contents

"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.prettifyVersion = prettifyVersion;
exports.prettifyTargets = prettifyTargets;

var _targets = require("./targets");

const semver = require("semver");

function prettifyVersion(version) {
  if (typeof version !== "string") {
    return version;
  }

  const parts = [semver.major(version)];
  const minor = semver.minor(version);
  const patch = semver.patch(version);

  if (minor || patch) {
    parts.push(minor);
  }

  if (patch) {
    parts.push(patch);
  }

  return parts.join(".");
}

function prettifyTargets(targets) {
  return Object.keys(targets).reduce((results, target) => {
    let value = targets[target];
    const unreleasedLabel = _targets.unreleasedLabels[target];

    if (typeof value === "string" && unreleasedLabel !== value) {
      value = prettifyVersion(value);
    }

    results[target] = value;
    return results;
  }, {});
}

Version data entries

4 entries across 3 versions & 2 rubygems

Version Path
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/@babel/helper-compilation-targets/lib/pretty.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/@babel/helper-compilation-targets/lib/pretty.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/@babel/helper-compilation-targets/lib/pretty.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/@babel/helper-compilation-targets/lib/pretty.js