mapRegExpStr = (val) => {
  if (isString(val)) {
    const {groups} = val.match(/^\/(?<regex>[^/]+)(?:\/?(?<flags>[igmy]+))?\/$/) || {};
    const {regex, flags} = groups || {};

    return (groups && new RegExp(escapeRegExp(regex), flags)) || val;
  }

  if (Array.isArray(val)) {
    return val.map((v) => mapRegExpStr(v));
  }

  return val;
}
Return regex if value is a string like this: '/.../g'
@param {mixed} val Value to process
@returns {mixed} Mapped values