UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks

18 lines (17 loc) 866 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.wrapInstalledPackages = wrapInstalledPackages; const isAnyPkgAlreadyRequired_1 = require("../helpers/isAnyPkgAlreadyRequired"); const applyHooks_1 = require("./applyHooks"); const Hooks_1 = require("./hooks/Hooks"); function wrapInstalledPackages(wrappers, serverless) { const hooks = new Hooks_1.Hooks(); wrappers.forEach((wrapper) => { wrapper.wrap(hooks); }); if (!serverless && (0, isAnyPkgAlreadyRequired_1.isAnyPkgAlreadyRequired)(hooks.getPackages())) { // eslint-disable-next-line no-console console.warn("AIKIDO: Some packages can't be protected because they were imported before Zen was initialized. Please make sure to import Zen as the first module in your application."); } return (0, applyHooks_1.applyHooks)(hooks); }