UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.

15 lines (14 loc) 626 B
"use strict"; 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; }