"use strict";

exports.__esModule = true;
exports.getURLParamByKey = void 0;

var _getUrlParam = require("./getUrlParam");

/**
 *  ---
 *  获取 URL 传递指定参数<br/>
 *
 * @param    {string | undefined}  [key=undefined]  参数key键
 * @returns  {string | object}  key键对应的值  默认返回全部的参数值
 * @function  getURLParamByKey
 * @author    libo
 * @static
 * @example example 01 缺省key值
 * --------------------------------------------------------------------------
 *
 *  import { getURLParamByKey } from '@riil-frontend/utils';
 *  getURLParamByKey();
 *
 *
 *  eg: url = http://localhost/riil-biz-frontend/dist/#/module/function?id=123&name=appbir&ts=1571105560850
 *  // result
 *  {
 *    "id": "123",
 *    "name": "appbir",
 *    "ts": "1571105560850"
 *  }
 * @example example 02 指定key
 * --------------------------------------------------------------------------
 * getURLParamByKey('id');
 *
 * // result
 * "123"
 *
 */
var getURLParamByKey = function getURLParamByKey(key) {
  var URLParam = (0, _getUrlParam.getUrlParam)();
  return key ? URLParam[key] : URLParam;
};

exports.getURLParamByKey = getURLParamByKey;