cookie-getter
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -5,4 +5,7 @@ // simple commonJS cookie reader, best perf according to http://jsperf.com/cookie-parsing | ||
setPos = cookie.indexOf(name + '='), | ||
stopPos = cookie.indexOf(';', setPos); | ||
return !~setPos ? null : cookie.substring(setPos, ~stopPos ? stopPos : undefined).split('=')[1]; | ||
stopPos = cookie.indexOf(';', setPos), | ||
res; | ||
if (!~setPos) return null; | ||
res = decodeURIComponent(cookie.substring(setPos, ~stopPos ? stopPos : undefined).split('=')[1]); | ||
return (res.charAt(0) === '{') ? JSON.parse(res) : res; | ||
}; |
@@ -5,3 +5,3 @@ { | ||
"description": "Super light, high performance clientside cookie reader. Common JS and clientmodules compatible.", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"tags": ["cookie", "cookies", "client", "clientmodules"], | ||
@@ -8,0 +8,0 @@ "repository": { |
@@ -5,3 +5,3 @@ # cookie-getter | ||
CommmonJS and [clientmodules](https://github.com/henrikjoreteg/clientmodules) compatible. | ||
CommmonJS and [browserify](http://browserify.org/) compatible. | ||
@@ -13,3 +13,3 @@ | ||
Handy to have as a seperate module for easy installation with npm and clientmodules. | ||
Handy to have as a seperate module for easy installation with npm. | ||
@@ -16,0 +16,0 @@ |
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
1691
10