New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

es-cookies

Package Overview
Dependencies
Maintainers
2
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es-cookies - npm Package Compare versions

Comparing version 2.1.12 to 2.1.13

lib/escookies.js

87

lib/cookies.js

@@ -8,12 +8,44 @@ 'use strict';

// src/cookie.coffee
var Cookie;
// src/cookies.coffee
var Cookies;
Cookie = class Cookie {
contructor(defaults = {}) {
this.defaults = defaults;
Cookies = (function() {
function Cookies(defaults) {
this.defaults = defaults != null ? defaults : {};
this.get = (function(_this) {
return function(key) {
return _this.api(key);
};
})(this);
this.remove = (function(_this) {
return function(key, attrs) {
return _this.api(key, '', objectAssign({
expires: -1
}, attrs));
};
})(this);
this.set = (function(_this) {
return function(key, value, attrs) {
return _this.api(key, value, attrs);
};
})(this);
this.getJSON = (function(_this) {
return function(key) {
var err, val;
val = _this.api(key);
if (val == null) {
return {};
}
try {
return JSON.parse(val);
} catch (error) {
err = error;
return val;
}
};
})(this);
}
api(key, value, attrs) {
var attr, cookie, cookies, err, expires, i, name, parts, rdecode, result, strAttrs;
Cookies.prototype.api = function(key, value, attrs) {
var attr, cookie, cookies, err, expires, i, kv, len, name, parts, rdecode, result, strAttrs;
if (typeof document === 'undefined') {

@@ -63,5 +95,5 @@ return;

rdecode = /(%[0-9A-Z]{2})+/g;
i = 0;
while (i < cookies.length) {
parts = cookies[i].split('=');
for (i = 0, len = cookies.length; i < len; i++) {
kv = cookies[i];
parts = kv.split('=');
cookie = parts.slice(1).join('=');

@@ -75,4 +107,3 @@ if (cookie.charAt(0) === '"') {

if (key === name) {
result = cookie;
break;
return cookie;
}

@@ -87,36 +118,14 @@ if (!key) {

return result;
}
};
get(key) {
return this.api.get(key);
}
return Cookies;
getJSON(key) {
var err;
try {
return JSON.parse(this.api.get(key));
} catch (error) {
err = error;
return {};
}
}
})();
set(key, value, attrs) {
return this.api(key, value, attrs);
}
var Cookies$1 = Cookies;
remove(key, attrs) {
return this.api(key, '', objectAssign(attrs, {
expires: -1
}));
}
};
var Cookie$1 = Cookie;
// src/index.coffee
var index = new Cookie$1();
var index = new Cookies$1();
module.exports = index;
//# sourceMappingURL=cookies.js.map
{
"name": "es-cookies",
"version": "2.1.12",
"version": "2.1.13",
"description": "Module-friendly fork of js-cookie. A simple, lightweight JavaScript API for handling cookies",

@@ -43,5 +43,5 @@ "main": "lib/cookies.js",

"coffee-script": "1.12.4",
"handroll": "0.13.1",
"qunitjs": "2.3.0",
"shortcake": "1.2.8"
}
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc