Comparing version 2.0.0 to 2.1.0
11
index.js
@@ -18,3 +18,4 @@ | ||
* Add ETag header field. | ||
* | ||
* @param {object} [options] see https://github.com/jshttp/etag#options | ||
* @param {boolean} [options.weak] | ||
* @return {Function} | ||
@@ -24,3 +25,3 @@ * @api public | ||
function etag() { | ||
function etag(options) { | ||
return function *etag(next){ | ||
@@ -45,7 +46,7 @@ yield* next; | ||
if (!s) return; | ||
etag = calculate(s); | ||
etag = calculate(s, options); | ||
} else if (('string' == typeof body) || Buffer.isBuffer(body)) { | ||
etag = calculate(body); | ||
etag = calculate(body, options); | ||
} else { | ||
etag = calculate(JSON.stringify(body)); | ||
etag = calculate(JSON.stringify(body), options); | ||
} | ||
@@ -52,0 +53,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"repository": "koajs/etag", | ||
"version": "2.0.0", | ||
"version": "2.1.0", | ||
"keywords": [ | ||
@@ -21,6 +21,6 @@ "koa", | ||
"devDependencies": { | ||
"istanbul-harmony": "0", | ||
"istanbul": "^0.4.0", | ||
"koa": "*", | ||
"should": "3", | ||
"mocha": "1", | ||
"mocha": "2", | ||
"supertest": "0", | ||
@@ -35,6 +35,6 @@ "koa-static": "1" | ||
"scripts": { | ||
"test": "mocha --harmony-generators --reporter spec --require should", | ||
"test-cov": "node --harmony-generators node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should", | ||
"test-travis": "node --harmony-generators node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should" | ||
"test": "mocha --harmony --reporter spec --require should", | ||
"test-cov": "node --harmony node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --require should", | ||
"test-travis": "node --harmony node_modules/.bin/istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot --require should" | ||
} | ||
} |
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
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
4737
4
44
1