🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
DemoInstallSign in
Socket

express-static-gzip

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-static-gzip - npm Package Compare versions

Comparing version

to
2.0.7

0

index.d.ts

@@ -0,0 +0,0 @@ // Type definitions for express-static-gzip 2.0

@@ -0,0 +0,0 @@ let fs = require("fs");

@@ -0,0 +0,0 @@ MIT License

2

package.json
{
"name": "express-static-gzip",
"version": "2.0.6",
"version": "2.0.7",
"description": "simple wrapper on top of express.static, that allows serving pre-gziped files",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -5,2 +5,3 @@

[![npm][npm-version-image]][npm-url]
![Node CI](https://github.com/tkoenig89/express-static-gzip/workflows/Node%20CI/badge.svg?branch=master&event=push)
[![npm][npm-downloads-image]][npm-url]

@@ -7,0 +8,0 @@ [![Donate][donate-paypal-image]][donate-url]

@@ -0,0 +0,0 @@ const expect = require('chai').expect;

@@ -68,2 +68,12 @@ const expect = require('chai').expect;

});
it('should treat identity as null', function () {
const result = findEncoding('identity;q=1, gzip;q=0.5', [GZIP]);
expect(result).to.be.null;
});
it('should not use encodings with q=0', function () {
const result = findEncoding('br;q=1, *;q=0', [GZIP]);
expect(result).to.be.null;
});
});

@@ -0,0 +0,0 @@ const expect = require('chai').expect;

// see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Accept-Encoding
// Indicates the identity function (i.e. no compression, nor modification)
const IDENTITY = 'identity';
/**

@@ -21,2 +24,5 @@ *

for (const encoding of sortedEncodingList) {
if (encoding === IDENTITY) {
return null;
}
for (let i = 0; i < availableCompressions.length; i++) {

@@ -62,2 +68,3 @@ if (encoding === '*' || encoding === availableCompressions[i].encodingName) {

.sort((encodingA, encodingB) => encodingB.q - encodingA.q)
.filter(encoding => encoding.q > 0)
.map(encoding => encoding.name);

@@ -90,2 +97,2 @@ }

findEncoding: findEncoding
};
};

@@ -0,0 +0,0 @@ module.exports = {

Sorry, the diff of this file is not supported yet