"use strict";

var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

var _Object$defineProperty = require("@babel/runtime-corejs3/core-js-stable/object/define-property");

_Object$defineProperty(exports, "__esModule", {
  value: true
});

exports.default = void 0;

var _promise = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/promise"));

var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/asyncToGenerator"));

var _npmRegistryClient = _interopRequireDefault(require("npm-registry-client"));

var _registryUrl = _interopRequireDefault(require("registry-url"));

const npmClient = new _npmRegistryClient.default();

var _default =
/*#__PURE__*/
function () {
  var _ref = (0, _asyncToGenerator2.default)(function* (packageName) {
    return new _promise.default((resolve, reject) => {
      npmClient.distTags.fetch((0, _registryUrl.default)(), {
        package: packageName,
        auth: {}
      }, (error, data) => {
        if (!!error) return reject(error);
        return resolve(data);
      });
    });
  });

  return function (_x) {
    return _ref.apply(this, arguments);
  };
}();

exports.default = _default;
module.exports = exports.default;