New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

koa-cash

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-cash - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

15

index.js

@@ -5,3 +5,2 @@ 'use strict'

const toArray = require('stream-to-array')
const compress = require('mz/zlib').gzip
const isJSON = require('koa-is-json')

@@ -11,6 +10,8 @@ const Bluebird = require('bluebird')

const compress = Bluebird.promisify(require('zlib').gzip)
// methods we cache
const methods = {
HEAD: true,
GET: true,
GET: true
}

@@ -52,5 +53,4 @@

if (obj.gzip
&& this.request.acceptsEncodings('gzip', 'identity') === 'gzip') {
this.response.body = obj.gzip
if (obj.gzip && this.request.acceptsEncodings('gzip', 'identity') === 'gzip') {
this.response.body = new Buffer(obj.gzip)
this.response.set('Content-Encoding', 'gzip')

@@ -107,3 +107,3 @@ } else {

lastModified: this.response.lastModified || null,
etag: this.response.get('etag') || null,
etag: this.response.get('etag') || null
}

@@ -113,4 +113,3 @@

obj.gzip = yield compress(body)
if (!fresh
&& this.request.acceptsEncodings('gzip', 'identity') === 'gzip') {
if (!fresh && this.request.acceptsEncodings('gzip', 'identity') === 'gzip') {
this.response.body = obj.gzip

@@ -117,0 +116,0 @@ this.response.set('Content-Encoding', 'gzip')

{
"name": "koa-cash",
"description": "HTTP response caching for Koa",
"version": "2.0.0",
"version": "2.1.0",
"dependencies": {
"bluebird": "^3.1.1",
"bytes": "^2.1.0",
"compressible": "2",
"koa-is-json": "1",
"mz": "^2.0.0",
"stream-to-array": "2"
"compressible": "^2.0.0",
"koa-is-json": "^1.0.0",
"stream-to-array": "^2.0.0"
},
"devDependencies": {
"babel-eslint": "^4.1.6",
"eslint": "^1.10.3",
"eslint-config-jongleberry": "^1.2.3",
"eslint-plugin-react": "^3.15.0",
"eslint-plugin-standard": "^1.3.1",
"istanbul": "0",
"koa": "1",
"istanbul": "^0.4.2",
"koa": "^1.0.0",
"lru-cache": "^4.0.0",
"mocha": "^2.3.3",
"mocha": "^3.1.2",
"standard": "^7.0.0",
"supertest": "^1.1.0"
},
"scripts": {
"lint": "eslint index.js test",
"lint": "standard index.js test/**/*.js",
"test": "NODE_ENV=test mocha",

@@ -28,0 +23,0 @@ "test-cov": "NODE_ENV=test node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha",

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