cookie-master
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -32,7 +32,18 @@ const _ = require('lodash'); | ||
return str; | ||
}, ""); | ||
}, ""); | ||
} | ||
else if (_.isObject(cookies)) | ||
{ | ||
return (new Cookie(cookies)).toString(); | ||
if ((cookies.name != null) && (cookies.value != null)) | ||
{ | ||
return (new Cookie(cookies)).toString(); | ||
} | ||
else | ||
{ | ||
let newCookies = []; | ||
_.forEach(cookies, (value, key) => { | ||
newCookies.push(new Cookie(`${key}=${value}`)); | ||
}); | ||
return this.toCookieString(newCookies); | ||
} | ||
} | ||
@@ -39,0 +50,0 @@ } |
{ | ||
"name": "cookie-master", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"description": "HTTP cookie parser tool", | ||
@@ -5,0 +5,0 @@ "main": "cookies.js", |
15646
290