augmenttoolkit / node_modules /@nestjs /platform-express /adapters /utils /get-body-parser-options.util.js
Leon4gr45's picture
Include updated package-lock.json (part 10)
cfbbc1a verified
Raw
History Blame Contribute Delete
523 Bytes
"use strict";
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;
}