Spaces:
Sleeping
Sleeping
augmenttoolkit / node_modules /@nestjs /platform-express /adapters /utils /get-body-parser-options.util.js
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.getBodyParserOptions = getBodyParserOptions; | |
| const rawBodyParser = (req, _res, buffer) => { | |
| if (Buffer.isBuffer(buffer)) { | |
| req.rawBody = buffer; | |
| } | |
| return true; | |
| }; | |
| function getBodyParserOptions(rawBody, options) { | |
| let parserOptions = (options || {}); | |
| if (rawBody === true) { | |
| parserOptions = { | |
| ...parserOptions, | |
| verify: rawBodyParser, | |
| }; | |
| } | |
| return parserOptions; | |
| } | |