@ssports_fe/ssutils
Version:
26 lines (24 loc) • 553 B
JavaScript
function extend() {
let i = 0;
let result = {};
for (; i < arguments.length; i++) {
let attributes = arguments[i];
for (let key in attributes) {
if (attributes.hasOwnProperty(key)) {
result[key] = attributes[key];
}
}
}
return result;
}
/**
*
* @desc 根据key删除cookie
* @param {String} key 要删除的cookie得key
*/
function removeCookie(key, attributes) {
set(key, '', extend(attributes, {
expires: -1
}));
}
module.exports = removeCookie;