Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
exports.parseIPv4 = function parseIPv4(ip) {
var v4Address = new IPv4.Address(ip);
if (!v4Address.isValid()) {
throw new Error("Invalid IPv4 address");
}
return v4Address.parsedAddress;
};