You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

19 lines
523 B

"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;
}