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.

13 lines (12 loc) 529 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.addIPv4MappedAddresses = addIPv4MappedAddresses; const mapIPv4ToIPv6_1 = require("./mapIPv4ToIPv6"); /** * Adds IPv4-mapped IPv6 versions for all IPv4 addresses in the array. * e.g. ["1.2.3.4", "2001:db8::/32"] -> ["1.2.3.4", "2001:db8::/32", "::ffff:1.2.3.4/128"] */ function addIPv4MappedAddresses(ips) { const ipv4Addresses = ips.filter((ip) => !ip.includes(":")); return ips.concat(ipv4Addresses.map(mapIPv4ToIPv6_1.default)); }