egg-cookies
Advanced tools
Comparing version 2.2.0 to 2.2.1
2.2.1 / 2017-02-22 | ||
================== | ||
* fix: emit on ctx.app (#5) | ||
2.2.0 / 2017-02-21 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -7,3 +7,2 @@ 'use strict'; | ||
const Cookie = require('./cookie'); | ||
const EventEmitter = require('events'); | ||
@@ -19,5 +18,4 @@ const KEYS_ARRAY = Symbol('eggCookies:keysArray'); | ||
class Cookies extends EventEmitter { | ||
class Cookies { | ||
constructor(ctx, keys) { | ||
super(); | ||
this[KEYS_ARRAY] = keys; | ||
@@ -27,2 +25,3 @@ this._keys = keys; | ||
this.secure = this.ctx.secure; | ||
this.app = ctx.app; | ||
} | ||
@@ -110,3 +109,3 @@ | ||
if (value.length > 4093) { | ||
this.emit('cookieLimitExceed', { name, value }); | ||
this.app.emit('cookieLimitExceed', { name, value, ctx: this.ctx }); | ||
} | ||
@@ -113,0 +112,0 @@ |
{ | ||
"name": "egg-cookies", | ||
"version": "2.2.0", | ||
"version": "2.2.1", | ||
"description": "cookies module for egg", | ||
@@ -23,3 +23,2 @@ "files": [ | ||
"eslint-config-egg": "^3.2.0", | ||
"intelli-espower-loader": "^1.0.1", | ||
"keygrip": "^1.0.1", | ||
@@ -35,4 +34,4 @@ "power-assert": "^1.4.2" | ||
"scripts": { | ||
"test": "egg-bin test --require intelli-espower-loader", | ||
"cov": "egg-bin cov --require intelli-espower-loader", | ||
"test": "egg-bin test", | ||
"cov": "egg-bin cov", | ||
"lint": "eslint index.js test", | ||
@@ -39,0 +38,0 @@ "ci": "npm run lint && npm run cov", |
@@ -53,1 +53,5 @@ # egg-cookies | ||
``` | ||
## License | ||
[MIT](LICENSE.txt) |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
10
57
0
13055
260