Socket
Socket
Sign inDemoInstall

js-cookie

Package Overview
Dependencies
0
Maintainers
2
Versions
32
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.1 to 3.0.2

36

dist/js.cookie.js

@@ -1,2 +0,2 @@

/*! js-cookie v3.0.1 | MIT */
/*! js-cookie v3.0.2 | MIT */
;

@@ -6,8 +6,8 @@ (function (global, factory) {

typeof define === 'function' && define.amd ? define(factory) :
(global = global || self, (function () {
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
var current = global.Cookies;
var exports = global.Cookies = factory();
exports.noConflict = function () { global.Cookies = current; return exports; };
}()));
}(this, (function () { 'use strict';
})());
})(this, (function () { 'use strict';

@@ -46,3 +46,3 @@ /* eslint-disable no-var */

function init (converter, defaultAttributes) {
function set (key, value, attributes) {
function set (name, value, attributes) {
if (typeof document === 'undefined') {

@@ -61,3 +61,3 @@ return

key = encodeURIComponent(key)
name = encodeURIComponent(name)
.replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent)

@@ -89,7 +89,7 @@ .replace(/[()]/g, escape);

return (document.cookie =
key + '=' + converter.write(value, key) + stringifiedAttributes)
name + '=' + converter.write(value, name) + stringifiedAttributes)
}
function get (key) {
if (typeof document === 'undefined' || (arguments.length && !key)) {
function get (name) {
if (typeof document === 'undefined' || (arguments.length && !name)) {
return

@@ -107,6 +107,6 @@ }

try {
var foundKey = decodeURIComponent(parts[0]);
jar[foundKey] = converter.read(value, foundKey);
var found = decodeURIComponent(parts[0]);
jar[found] = converter.read(value, found);
if (key === foundKey) {
if (name === found) {
break

@@ -117,3 +117,3 @@ }

return key ? jar[key] : jar
return name ? jar[name] : jar
}

@@ -123,7 +123,7 @@

{
set: set,
get: get,
remove: function (key, attributes) {
set,
get,
remove: function (name, attributes) {
set(
key,
name,
'',

@@ -154,2 +154,2 @@ assign({}, attributes, {

})));
}));

@@ -1,2 +0,2 @@

/*! js-cookie v3.0.1 | MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}return function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"})}));
/*! js-cookie v3.0.2 | MIT */
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)e[o]=n[o]}return e}var t=function t(n,o){function r(t,r,i){if("undefined"!=typeof document){"number"==typeof(i=e({},o,i)).expires&&(i.expires=new Date(Date.now()+864e5*i.expires)),i.expires&&(i.expires=i.expires.toUTCString()),t=encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape);var c="";for(var u in i)i[u]&&(c+="; "+u,!0!==i[u]&&(c+="="+i[u].split(";")[0]));return document.cookie=t+"="+n.write(r,t)+c}}return Object.create({set:r,get:function(e){if("undefined"!=typeof document&&(!arguments.length||e)){for(var t=document.cookie?document.cookie.split("; "):[],o={},r=0;r<t.length;r++){var i=t[r].split("="),c=i.slice(1).join("=");try{var u=decodeURIComponent(i[0]);if(o[u]=n.read(c,u),e===u)break}catch(e){}}return e?o[e]:o}},remove:function(t,n){r(t,"",e({},n,{expires:-1}))},withAttributes:function(n){return t(this.converter,e({},this.attributes,n))},withConverter:function(n){return t(e({},this.converter,n),this.attributes)}},{attributes:{value:Object.freeze(o)},converter:{value:Object.freeze(n)}})}({read:function(e){return'"'===e[0]&&(e=e.slice(1,-1)),e.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent)},write:function(e){return encodeURIComponent(e).replace(/%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,decodeURIComponent)}},{path:"/"});return t}));
{
"name": "js-cookie",
"version": "3.0.1",
"version": "3.0.2",
"description": "A simple, lightweight JavaScript API for handling cookies",

@@ -46,13 +46,13 @@ "browser": "dist/js.cookie.js",

"devDependencies": {
"browserstack-runner": "^0.9.0",
"@rollup/plugin-terser": "^0.4.0",
"browserstack-runner": "github:browserstack/browserstack-runner#1e85e559951bdf97ffe2a7c744ee67ca83589fde",
"eslint": "^7.31.0",
"eslint-config-standard": "^16.0.3",
"eslint-plugin-promise": "^5.1.0",
"eslint-plugin-html": "^6.0.0",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-html": "^7.0.0",
"eslint-plugin-markdown": "^3.0.0",
"grunt": "^1.0.4",
"grunt-compare-size": "^0.4.2",
"grunt-contrib-connect": "^3.0.0",
"grunt-contrib-nodeunit": "^3.0.0",
"grunt-contrib-qunit": "^3.1.0",
"grunt-contrib-nodeunit": "^5.0.0",
"grunt-contrib-qunit": "^7.0.0",
"grunt-contrib-watch": "^1.1.0",

@@ -63,12 +63,12 @@ "grunt-exec": "^3.0.0",

"qunit": "^2.9.3",
"release-it": "^14.10.0",
"rollup": "^2.0.0",
"rollup-plugin-filesize": "^9.1.1",
"rollup-plugin-license": "^2.5.0",
"rollup-plugin-terser": "^7.0.2",
"standard": "^16.0.3"
"release-it": "^15.0.0",
"rollup": "^3.17.2",
"rollup-plugin-filesize": "^10.0.0",
"rollup-plugin-license": "^3.0.0",
"standard": "^17.0.0"
},
"engines": {
"node": ">=12"
"node": ">=14",
"npm": ">=9.5.0"
}
}

@@ -5,3 +5,3 @@ <p align="center">

# JavaScript Cookie [![Build Status](https://travis-ci.com/js-cookie/js-cookie.svg?branch=master)](https://travis-ci.com/js-cookie/js-cookie) [![BrowserStack Status](https://www.browserstack.com/automate/badge.svg?badge_key=b3VDaHAxVDg0NDdCRmtUOWg0SlQzK2NsRVhWTjlDQS9qdGJoak1GMzJiVT0tLVhwZHNvdGRoY284YVRrRnI3eU1JTnc9PQ==--5e88ffb3ca116001d7ef2cfb97a4128ac31174c2)](https://www.browserstack.com/automate/public-build/b3VDaHAxVDg0NDdCRmtUOWg0SlQzK2NsRVhWTjlDQS9qdGJoak1GMzJiVT0tLVhwZHNvdGRoY284YVRrRnI3eU1JTnc9PQ==--5e88ffb3ca116001d7ef2cfb97a4128ac31174c2) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Code Climate](https://codeclimate.com/github/js-cookie/js-cookie.svg)](https://codeclimate.com/github/js-cookie/js-cookie) [![npm](https://img.shields.io/github/package-json/v/js-cookie/js-cookie)](https://www.npmjs.com/package/js-cookie) [![size](https://img.shields.io/bundlephobia/minzip/js-cookie/3)](https://www.npmjs.com/package/js-cookie) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/js-cookie/badge?style=rounded)](https://www.jsdelivr.com/package/npm/js-cookie)
# JavaScript Cookie [![CI](https://github.com/js-cookie/js-cookie/actions/workflows/ci.yml/badge.svg)](https://github.com/js-cookie/js-cookie/actions/workflows/ci.yml) [![BrowserStack](https://github.com/js-cookie/js-cookie/actions/workflows/browserstack.yml/badge.svg)](https://github.com/js-cookie/js-cookie/actions/workflows/browserstack.yml) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![Code Climate](https://codeclimate.com/github/js-cookie/js-cookie.svg)](https://codeclimate.com/github/js-cookie/js-cookie) [![npm](https://img.shields.io/github/package-json/v/js-cookie/js-cookie)](https://www.npmjs.com/package/js-cookie) [![size](https://img.shields.io/bundlephobia/minzip/js-cookie/3)](https://www.npmjs.com/package/js-cookie) [![jsDelivr Hits](https://data.jsdelivr.com/v1/package/npm/js-cookie/badge?style=rounded)](https://www.jsdelivr.com/package/npm/js-cookie)

@@ -21,3 +21,3 @@ A simple, lightweight JavaScript API for handling cookies

**πŸ‘‰πŸ‘‰ If you're viewing this at https://github.com/js-cookie/js-cookie, you're reading the documentation for the master branch.
**πŸ‘‰πŸ‘‰ If you're viewing this at https://github.com/js-cookie/js-cookie, you're reading the documentation for the main branch.
[View documentation for the latest release.](https://github.com/js-cookie/js-cookie/tree/latest#readme) πŸ‘ˆπŸ‘ˆ**

@@ -31,5 +31,5 @@

```bash
npm i js-cookie
```
$ npm i js-cookie
```

@@ -307,5 +307,5 @@ The npm package has a `module` field pointing to an ES module variant of the library, mainly to provide support for ES module aware bundlers, whereas its `browser` field points to an UMD module for full backward compatibility.

```bash
npm i @types/js-cookie
```
$ npm i @types/js-cookie
```

@@ -326,16 +326,4 @@ ## Server-side integration

We are using [release-it](https://www.npmjs.com/package/release-it) for automated releasing.
For releasing there's the `Release` GitHub Actions workflow, which will create a new release along with package provenance on npmjs.com.
Start a dry run to see what would happen:
```
$ npm run release minor -- --dry-run
```
Do a real release (publishes both to npm as well as create a new release on GitHub):
```
$ npm run release minor
```
_GitHub releases are created as a draft and need to be published manually!

@@ -342,0 +330,0 @@ (This is so we are able to craft suitable release notes before publishing.)_

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚑️ by Socket Inc