beaugunderson / ip-address

💻 a library for parsing and manipulating IPv4 and IPv6 addresses in JavaScript
http://ip-address.js.org/
MIT License
580 stars 73 forks source link

Wildcard support? #117

Open lekoaf opened 4 years ago

lekoaf commented 4 years ago

It seems like this library doesn't support wildcard IP-addresses.

This was not obvious before the 7.0.0 release, since you didn't instantly fail the address in the constructor.

Now:

try {
    const address = new Address4('192.168.0.*')
} catch (err) {
    console.log(err) // AddressError: Invalid IPv4 address.
}

Why are wildcard IPs not considered valid? This made the change to ip-address v7 fail an important part of my application I'm afraid.

lekoaf commented 4 years ago

Hmm, apparently the asterix might not be a standard. So perhaps we've done something wrong instead.