"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.formatValues = void 0;
var _formatExpire = require("../../../helpers/formatExpire");
const PARSER = [/[^\d]/g, ''];
const SLASH = '/';
const formatValues = function () {
  let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
  let {
    expire: currentExpire = ''
  } = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  let {
    expire = '',
    name = ''
  } = values;
  expire = "".concat(expire.substr(0, 2).replace(...PARSER)).concat(expire.substr(2, 1) ? SLASH : '').concat(expire.substr(3, 2).replace(...PARSER));
  name = name.toUpperCase();
  expire = expire.length === 2 ? expire.length > currentExpire.length ? "".concat(expire).concat(SLASH) : expire[0] : expire;
  expire = (0, _formatExpire.formatExpire)(expire);
  return {
    expire,
    name
  };
};
exports.formatValues = formatValues;
//# sourceMappingURL=formatValues.js.map