"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }

/* eslint-disable @typescript-eslint/ban-types */
var _default = function _default(obj) {
  return function (v) {
    var defaultValue = obj['default'];
    var value = defaultValue;
    Object.keys(obj).forEach(function (key) {
      key.split(',').forEach(function (item) {
        // eslint-disable-next-line eqeqeq
        if (item == v) {
          value = obj[key];
        }
      });
    });

    if (_typeof(value) === 'object' && _typeof(defaultValue) === 'object') {
      Object.keys(defaultValue).forEach(function (key) {
        if (value[key] === undefined) {
          value[key] = defaultValue[key];
        }
      });
    }

    return value;
  };
};

exports.default = _default;