/usr/lib/nodejs/compressible/index.js is in node-compressible 2.0.1-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | /*!
* compressible
* Copyright(c) 2014 Jeremiah Senkpiel
* MIT Licensed
*/
/**
* Module dependencies.
*/
var db = require('mime-types').db
/**
* Module exports.
*/
module.exports = compressible
/**
* Checks if a type is compressible.
*
* @param {string} type
* @return {Boolean} compressible
*/
function compressible(type) {
if (!type || typeof type !== "string") return false
// Strip charset
var i = type.indexOf(';')
if (~i) type = type.slice(0, i)
// handle types that have capitals or excess space
type = type.trim().toLowerCase()
// attempt to look up from database; fallback to regex if not found
var mime = db[type]
return mime ? mime.compressible : /^text\/|\+json$|\+text$|\+xml$/.test(type)
}
|