whitequark / ipaddr.js

IP address manipulation library in JavaScript
MIT License
576 stars 92 forks source link

IPv6 `includes()` gets the answer wrong. #172

Closed tomkcook closed 10 months ago

tomkcook commented 11 months ago

eg:

> ip = ipaddr.parse('fd5e:ea3a:c90e:753f:d625:ccff:feb3:80a4');
> range = ipaddr.parseCIDR('fd5e::/16');
> range.includes(ip)
false
tomkcook commented 11 months ago

nvm, includes isn't part of the API, is it? Feel free to reject this.

whitequark commented 10 months ago

parseCIDR returns an object that is just an array. Of course it does not support your includes query.