parse-cookies.js
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -8,3 +8,3 @@ /** | ||
*/ | ||
export default function parseCookies(raw, dataParser) { | ||
export default function parseCookies (raw, dataParser) { | ||
// if empty string or undefined | ||
@@ -16,5 +16,5 @@ if (typeof raw === 'undefined' || (typeof raw === 'string' && raw === '')) { | ||
return raw.split(';').reduce(function (cookies, cookieString) { | ||
let cookiePair = cookieString.split('='); | ||
let cookiePair = cookieString.split('='); | ||
let cookieContent = cookiePair.length > 1 ? cookiePair[1].trim() : ''; | ||
let cookieName = cookiePair[0].trim(); | ||
let cookieName = cookiePair[0].trim(); | ||
@@ -21,0 +21,0 @@ if (typeof dataParser !== 'undefined') { |
{ | ||
"name": "parse-cookies.js", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Parses document.cookie string into an object (dictionary) by * splitting at ';' and '='.", | ||
@@ -8,2 +8,3 @@ "main": "lib/index.js", | ||
"clean": "rimraf lib/*", | ||
"lint": "eslint test index.js", | ||
"test": "node test/test.main.js | faucet", | ||
@@ -13,3 +14,3 @@ "patch": "npm version patch && npm run build && npm publish", | ||
"major": "npm version major && npm run build && npm publish", | ||
"prebuild": "npm run clean", | ||
"prebuild": "npm run clean && npm run lint & npm run test", | ||
"build": "babel index.js --out-file lib/index.js", | ||
@@ -36,3 +37,6 @@ "postpublish": "git push origin master --follow-tags" | ||
"babel": "latest", | ||
"faucet": "0.0.1", | ||
"eslint": "latest", | ||
"eslint-config-standard": "latest", | ||
"eslint-plugin-standard": "latest", | ||
"faucet": "latest", | ||
"rimraf": "latest", | ||
@@ -39,0 +43,0 @@ "tap-spec": "latest", |
@@ -8,2 +8,3 @@ # parse-cookies.js (written in ES6) | ||
[![devDependencies](http://img.shields.io/david/dev/meandmax/parse-cookies.js.svg?style=flat)](https://david-dm.org/meandmax/parse-cookies.js#info=devDependencies&view=table) | ||
[![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard) | ||
@@ -10,0 +11,0 @@ ### Install: |
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
6440
8
51
8