Closed frenchbread closed 2 years ago
Hey @frenchbread - When are you planning to merge this change into master and release a new version of the package?
Hi @slimkrazy, thanks for the heads up.
I was doing additional research on maybe adding some options whether input should be parsed from dec/hex (for ipv4) or not, but it turns out a bit trickier than I thought. So merging this as it is.
Published v2.3.0
changes (ref: #14)
adds support for:
dev
steps to test
git clone https://github.com/frenchbread/private-ip.git && cd private-ip
git checkout 055759755a10a9eb039110c8467df808a600409e
npm i
test.js
file for new payloads that you've provided & run tests withnpm run test
test.js
file, you can create test file yourself e.g.touch _test.js
and put following code in there:const payloads = [ 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', '2130706433', '0x7f000001', '100::ffff::', '::ffff:0.0.255.255.255', '::ffff:0.255.255.255.255', ]
payloads.forEach(payload => { console.log(payload, is_ip_private(payload)) })
// output should look like this: // ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff true // 2130706433 true // 0x7f000001 true // 100::ffff:: undefined // ::ffff:0.0.255.255.255 undefined // ::ffff:0.255.255.255.255 undefined