module.exports = compressible

compressible.specs =
compressible.specifications = require('./specifications.json')

compressible.regex
compressible.regexp = /json|text|javascript|dart|ecmascript|xml|x-font-ttf|ms-opentype|ms-fontobject/

function compressible(type) {
  return compressible.regexp.test(type)
}
module.exports = compressible

compressible.specs =
compressible.specifications = require('./specifications.json')

compressible.regex
compressible.regexp = /json|text|javascript|dart|ecmascript|xml|x-font-ttf|ms-opentype|ms-fontobject/

function compressible(type) {
  var spec = compressible.specs[type]
  return spec ? spec.compressible : false
}
Use object-key lookup to check for compressibility.
Use object-key lookup to check for compressibility.

JSPerf reports this as being 1.5+ times faster than using the regex.
