@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
15 lines (14 loc) • 418 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.replaceRequestBody = replaceRequestBody;
// Copies all properties from the stream to the base object
function replaceRequestBody(base, stream) {
for (const key in stream) {
let v = stream[key];
if (typeof v === "function") {
v = v.bind(base);
}
base[key] = v;
}
return base;
}