@aikidosec/firewall
Version:
Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks
16 lines (15 loc) • 515 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.addXmlToContext = addXmlToContext;
const Context_1 = require("../../agent/Context");
/**
* Adds the XML to the context XML array if it exists, or creates a new array if it doesn't.
*/
function addXmlToContext(xml, context) {
if (Array.isArray(context.xml)) {
(0, Context_1.updateContext)(context, "xml", context.xml.concat(xml));
}
else {
(0, Context_1.updateContext)(context, "xml", [xml]);
}
}