"use strict";

var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.isPackageUpdatable = void 0;
var _lt = _interopRequireDefault(require("semver/functions/lt"));
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0; you may not use this file except in compliance with the Elastic License
 * 2.0.
 */

const isPackageUpdatable = pkg => {
  var _pkg$installationInfo, _pkg$installationInfo2;
  return 'installationInfo' in pkg && (_pkg$installationInfo = pkg.installationInfo) !== null && _pkg$installationInfo !== void 0 && _pkg$installationInfo.version ? (0, _lt.default)((_pkg$installationInfo2 = pkg.installationInfo) === null || _pkg$installationInfo2 === void 0 ? void 0 : _pkg$installationInfo2.version, pkg.version) : false;
};
exports.isPackageUpdatable = isPackageUpdatable;