UNPKG

2.27 kBSource Map (JSON)View Raw
1{"version":3,"sources":["../src/define_config.ts"],"sourcesContent":["/*\n * @adonisjs/bodyparser\n *\n * (c) AdonisJS\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nimport { BodyParserConfig, BodyParserOptionalConfig } from './types.js'\n\n/**\n * Define config for the bodyparser middleware. Your defined config will be\n * merged with the default config\n */\nexport function defineConfig(config: BodyParserOptionalConfig): BodyParserConfig {\n return {\n allowedMethods: config.allowedMethods || ['POST', 'PUT', 'PATCH', 'DELETE'],\n\n form: {\n encoding: 'utf-8',\n limit: '1mb',\n queryString: {},\n types: ['application/x-www-form-urlencoded'],\n convertEmptyStringsToNull: true,\n ...config.form,\n },\n\n json: {\n encoding: 'utf-8',\n limit: '1mb',\n strict: true,\n types: [\n 'application/json',\n 'application/json-patch+json',\n 'application/vnd.api+json',\n 'application/csp-report',\n ],\n convertEmptyStringsToNull: true,\n ...config.json,\n },\n\n raw: {\n encoding: 'utf-8',\n limit: '1mb',\n types: ['text/*'],\n ...config.raw,\n },\n\n multipart: {\n autoProcess: true,\n processManually: [],\n encoding: 'utf-8',\n maxFields: 1000,\n limit: '20mb',\n types: ['multipart/form-data'],\n convertEmptyStringsToNull: true,\n ...config.multipart,\n },\n }\n}\n"],"mappings":";AAeO,SAAS,aAAa,QAAoD;AAC/E,SAAO;AAAA,IACL,gBAAgB,OAAO,kBAAkB,CAAC,QAAQ,OAAO,SAAS,QAAQ;AAAA,IAE1E,MAAM;AAAA,MACJ,UAAU;AAAA,MACV,OAAO;AAAA,MACP,aAAa,CAAC;AAAA,MACd,OAAO,CAAC,mCAAmC;AAAA,MAC3C,2BAA2B;AAAA,MAC3B,GAAG,OAAO;AAAA,IACZ;AAAA,IAEA,MAAM;AAAA,MACJ,UAAU;AAAA,MACV,OAAO;AAAA,MACP,QAAQ;AAAA,MACR,OAAO;AAAA,QACL;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA,2BAA2B;AAAA,MAC3B,GAAG,OAAO;AAAA,IACZ;AAAA,IAEA,KAAK;AAAA,MACH,UAAU;AAAA,MACV,OAAO;AAAA,MACP,OAAO,CAAC,QAAQ;AAAA,MAChB,GAAG,OAAO;AAAA,IACZ;AAAA,IAEA,WAAW;AAAA,MACT,aAAa;AAAA,MACb,iBAAiB,CAAC;AAAA,MAClB,UAAU;AAAA,MACV,WAAW;AAAA,MACX,OAAO;AAAA,MACP,OAAO,CAAC,qBAAqB;AAAA,MAC7B,2BAA2B;AAAA,MAC3B,GAAG,OAAO;AAAA,IACZ;AAAA,EACF;AACF;","names":[]}
\No newline at end of file