Socket
Socket
Sign inDemoInstall

koa-etag

Package Overview
Dependencies
Maintainers
7
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-etag - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

History.md

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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc