compressible
Advanced tools
Comparing version 2.0.8 to 2.0.9
@@ -0,1 +1,7 @@ | ||
2.0.9 / 2016-10-31 | ||
================== | ||
* Fix regex fallback to not override `compressible: false` in db | ||
* deps: mime-db@'>= 1.24.0 < 2' | ||
2.0.8 / 2016-05-12 | ||
@@ -2,0 +8,0 @@ ================== |
10
index.js
@@ -51,9 +51,9 @@ /*! | ||
if ((data && data.compressible) || compressibleTypeRegExp.test(mime)) { | ||
return true | ||
// return database information | ||
if (data && data.compressible !== undefined) { | ||
return data.compressible | ||
} | ||
return data | ||
? data.compressible | ||
: undefined | ||
// fallback to regexp or unknown | ||
return compressibleTypeRegExp.test(mime) || undefined | ||
} |
{ | ||
"name": "compressible", | ||
"description": "Compressible Content-Type / mime checking", | ||
"version": "2.0.8", | ||
"version": "2.0.9", | ||
"contributors": [ | ||
@@ -19,10 +19,10 @@ "Douglas Christopher Wilson <doug@somethingdoug.com>", | ||
"dependencies": { | ||
"mime-db": ">= 1.23.0 < 2" | ||
"mime-db": ">= 1.24.0 < 2" | ||
}, | ||
"devDependencies": { | ||
"eslint": "2.9.0", | ||
"eslint-config-standard": "5.3.1", | ||
"eslint-plugin-promise": "1.1.0", | ||
"eslint-plugin-standard": "1.3.2", | ||
"istanbul": "0.4.3", | ||
"eslint": "3.9.1", | ||
"eslint-config-standard": "6.2.1", | ||
"eslint-plugin-promise": "3.3.0", | ||
"eslint-plugin-standard": "2.0.1", | ||
"istanbul": "0.4.5", | ||
"mocha": "~1.21.5" | ||
@@ -40,3 +40,3 @@ }, | ||
"scripts": { | ||
"lint": "eslint **/*.js", | ||
"lint": "eslint .", | ||
"test": "mocha --reporter spec --bail --check-leaks test/", | ||
@@ -43,0 +43,0 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks", |
@@ -28,2 +28,14 @@ # compressible | ||
The MIME is looked up in the [`mime-db`](https://www.npmjs.com/package/mime-db) and | ||
if there is compressible information in the database entry, that is returned. Otherwise, | ||
this module will fallback to `true` for the following types: | ||
* `text/*` | ||
* `*/*+json` | ||
* `*/*+text` | ||
* `*/*+xml` | ||
If this module is not sure if a type is specifically compressible or specifically | ||
uncompressible, `undefined` is returned. | ||
```js | ||
@@ -30,0 +42,0 @@ compressible('text/html') // => true |
6373
59
Updatedmime-db@>= 1.24.0 < 2