BlueGit

blue-star danique-bot

Files

danique-bot / node_modules / parse-cookie-phantomjs / index.js

index.js

Import template
timfa Tim · pushed by timfa · 4 years ago
c788ad20 History
index.js 481 B Download Raw
1'use strict';
2var toughCookie = require('tough-cookie');
3
4module.exports = function (str) {
5 if (typeof str !== 'string') {
6 throw new TypeError('Expected a string');
7 }
8
9 var cookie = toughCookie.parse(str);
10
11 return {
12 // the touch-cookie output is slightly
13 // different from what PhantomJS accepts
14 name: cookie.key,
15 value: cookie.value,
16 domain: cookie.domain,
17 path: cookie.path,
18 httponly: cookie.httpOnly,
19 secure: cookie.secure,
20 expires: cookie.expires
21 };
22};