{"version":3,"file":"json.mjs","names":[],"sources":["../../src/middlewares/json.ts"],"sourcesContent":["import { errorUtils, validationUtils } from '@verdaccio/core';\n\nimport type { $NextFunctionVer, $RequestExtend, $ResponseExtend } from '../types';\n\nexport function expectJson(\n  req: $RequestExtend,\n  res: $ResponseExtend,\n  next: $NextFunctionVer\n): void {\n  if (!validationUtils.isObject(req.body)) {\n    return next(errorUtils.getBadRequest(\"can't parse incoming json\"));\n  }\n  next();\n}\n"],"mappings":";;AAIA,SAAgB,WACd,KACA,KACA,MACM;CACN,IAAI,CAAC,gBAAgB,SAAS,IAAI,IAAI,GACpC,OAAO,KAAK,WAAW,cAAc,2BAA2B,CAAC;CAEnE,KAAK;AACP"}