"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports["default"] = void 0;
/**
 * @name cookie取值
 * @param c_name 要取得的字段名
 * @returns {string} 返回字段对应的值, 若字段不存在则返回空
 */
var _default = function _default(c_name) {
  if (document.cookie.length > 0) {
    var c_start = document.cookie.indexOf("".concat(c_name, "="));
    if (c_start !== -1) {
      c_start = c_start + c_name.length + 1;
      var c_end = document.cookie.indexOf(';', c_start);
      if (c_end == -1) c_end = document.cookie.length;
      return unescape(document.cookie.substring(c_start, c_end));
    }
  }
  return '';
};
exports["default"] = _default;
//# sourceMappingURL=getCookie.js.map
