{"version":3,"sources":["jsdelivr-header.js","/npm/karma-suppress404-middleware@1.0.0/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACLA,MAAM,WAAa,QAAQ,oBAE3B,SAAS,aAAc,GACrB,MAAM,EAAQ,EAAI,MAAM,KACxB,OAAO,EAAM,EAAM,OAAS,EAC9B,CAEA,SAAS,QAAS,GAEhB,MAAO,CACL,OAAQ,yHACR,KAAM,YAEV,CAEA,SAAS,YAAa,EAAK,EAAK,GAC9B,MAAM,EAAY,aAAa,EAAI,KACnC,GAAI,WAAW,SAAS,GAAY,CAClC,MAAM,EAAO,QAAQ,GACf,EAAS,OAAO,KAAK,EAAK,OAAQ,UAKxC,OAJA,EAAI,UAAU,IAAK,CACjB,eAAgB,EAAK,KACrB,iBAAkB,EAAO,SAEpB,EAAI,IAAI,EACjB,CACA,GACF,CAGA,OAAO,QAAU","file":"/npm/karma-suppress404-middleware@1.0.0/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/karma-suppress404-middleware@1.0.0/index.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","// could improve this by handling other formats\nconst extensions = require('image-extensions')\n\nfunction getExtension (url) {\n  const parts = url.split('.')\n  return parts[parts.length - 1]\n}\n\nfunction getFile (extension) {\n  // could improve this by serving the right file per extension\n  return {\n    base64: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mNkYPhfDwAChwGA60e6kgAAAABJRU5ErkJggg==',\n    type: 'image/png'\n  }\n}\n\nfunction suppress404 (req, res, next) {\n  const extension = getExtension(req.url)\n  if (extensions.includes(extension)) {\n    const file = getFile(extension)\n    const buffer = Buffer.from(file.base64, 'base64')\n    res.writeHead(200, {\n      'Content-Type': file.type,\n      'Content-Length': buffer.length\n    })\n    return res.end(buffer)\n  }\n  next()\n}\n\n// could wrap in a function to pass extra options if required\nmodule.exports = suppress404\n\n"]}