{"version":3,"sources":["jsdelivr-header.js","/npm/json-body-parser@1.0.2/index.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACNA,MAAM,YAAc,CAClB,KAAM,QAGR,SAAS,OAAO,GACd,OAAO,IAAW,YAAY,IAChC,CAEA,SAAS,OAAO,GACd,OAAO,EAAK,QAAQ,qBAAuB,CAC7C,CAEA,OAAO,QAAU,CAAC,EAAK,EAAK,KAC1B,MAAM,EAAS,EAAI,OACb,EAAO,EAAI,QAAQ,gBACzB,GAAI,OAAO,IAAW,OAAO,GAAO,CAClC,IAAI,EAAO,GACX,EAAI,GAAG,QAAS,IAAY,GAAQ,KACpC,EAAI,GAAG,OAAO,KACZ,MAAM,EAAY,KAAK,MAAM,GAC7B,EAAI,KAAO,EACX,GAAK,GAET,MACE,GACF","file":"/npm/json-body-parser@1.0.2/index.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/json-body-parser@1.0.2/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","const HTTP_METHOD = {\n  POST: 'POST'\n}\n\nfunction isPOST(method) {\n  return method === HTTP_METHOD.POST\n}\n\nfunction isJSON(type) {\n  return type.indexOf('application/json') > -1\n}\n\nmodule.exports = (req, res, next) => {\n  const method = req.method,\n        type = req.headers['content-type']\n  if (isPOST(method) && isJSON(type)) {\n    let body = ''\n    req.on('data', (chunk) => { body += chunk })\n    req.on('end', () => {\n      const parseBody = JSON.parse(body)\n      req.body = parseBody\n      next()\n    })\n  } else {\n    next()\n  }\n}\n"]}