@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) • 626 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.checkIndexImportGuard = checkIndexImportGuard;
const symbol = Symbol.for("zen.nodejs.index.run.once");
function checkIndexImportGuard() {
const globalState = globalThis;
if (globalState[symbol]) {
// eslint-disable-next-line no-console
console.error("AIKIDO: Zen has already been initialized. This can lead to unexpected behavior and may be caused by cleaning the require cache or using multiple installations of Zen at the same time.");
return false;
}
globalState[symbol] = true;
return true;
}