simple-cookie
Advanced tools
Comparing version 1.0.8 to 1.0.9
26
index.js
@@ -20,7 +20,7 @@ function printExpires(expires){ | ||
obj.name+'='+value, | ||
( typeof obj.expires != 'undefined' && obj.expires ? printExpires(obj.expires) : '' ), | ||
( typeof obj.path != 'undefined' ? (obj.path ? 'Path='+obj.path : '') : 'Path=/' ), | ||
( typeof obj.domain != 'undefined' && obj.domain ? 'Domain='+obj.domain : '' ), | ||
( typeof obj.secure != 'undefined' && obj.secure ? 'secure' : '' ), | ||
( typeof obj.httponly != 'undefined' && obj.httponly ? 'HttpOnly' : '' ) | ||
( typeof obj.expires != 'undefined' && obj.expires ? printExpires(obj.expires) : '' ), | ||
( typeof obj.path != 'undefined' ? (obj.path ? 'Path='+obj.path : '') : 'Path=/' ), | ||
( typeof obj.domain != 'undefined' && obj.domain ? 'Domain='+obj.domain : '' ), | ||
( typeof obj.secure != 'undefined' && obj.secure ? 'secure' : '' ), | ||
( typeof obj.httponly != 'undefined' && obj.httponly ? 'HttpOnly' : '' ) | ||
@@ -31,3 +31,3 @@ ].join(';').replace(/;+/g,';').replace(/;$/,'').replace(/;/g,'; '); | ||
var s = string.replace(/;\s+/g,';').split(';') | ||
.map(function(s){return s.replace(/\s+\=\s+/g,'=').split('=');}); | ||
.map(function(s){return s.replace(/\s+\s+/g,'=').split('=');}); | ||
@@ -44,9 +44,9 @@ var n = s.shift(); | ||
var I, f = { | ||
httponly: function(){ obj.httponly = true; }, | ||
secure: function(){ obj.secure = true; }, | ||
expires: function(v){ obj.expires = new Date(v); }, | ||
'max-age': function(v){ if(obj.expires) return; obj.expires = new Date((new Date()).valueOf()+(v*1000)); }, | ||
path: function(v){ obj.path = v; }, | ||
domain: function(v){ obj.domain = v; } | ||
}; | ||
httponly: function(){ obj.httponly = true; }, | ||
secure: function(){ obj.secure = true; }, | ||
expires: function(v){ obj.expires = new Date(v); }, | ||
'max-age': function(v){ if(obj.expires) return; obj.expires = new Date((new Date()).valueOf()+(v*1000)); }, | ||
path: function(v){ obj.path = v; }, | ||
domain: function(v){ obj.domain = v; } | ||
}; | ||
@@ -53,0 +53,0 @@ for(var i in s) { |
{ | ||
"name": "simple-cookie", | ||
"version": "1.0.8", | ||
"version": "1.0.9", | ||
"description": "Simple cookie parser & serializer", | ||
@@ -27,6 +27,6 @@ "main": "index.js", | ||
"devDependencies": { | ||
"chai": "^3.5.0", | ||
"eslint": "^3.17.1", | ||
"mocha": "^3.2.0" | ||
"chai": "^4.1.2", | ||
"eslint": "^4.18.2", | ||
"mocha": "^5.0.3" | ||
} | ||
} |
@@ -81,7 +81,7 @@ | ||
var cc = [ | ||
{name:'cookiename1',value:'cookie name 1'}, | ||
{name:'cookiename2',value:'cookie name 2'}, | ||
{name:'cookiename3',value:'cookie name 3'}, | ||
{name:'cookiename4',value:'cookie name 4'}, | ||
{name:'cookiename5',value:'cookie name 5'} | ||
{name:'cookiename1',value:'cookie name 1'}, | ||
{name:'cookiename2',value:'cookie name 2'}, | ||
{name:'cookiename3',value:'cookie name 3'}, | ||
{name:'cookiename4',value:'cookie name 4'}, | ||
{name:'cookiename5',value:'cookie name 5'} | ||
]; | ||
@@ -96,2 +96,2 @@ | ||
}); | ||
}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41212
147