Skip to content

Commit bc5b56f

Browse files
committed
ip-address
I ran an audit and noticed that ipv6 was deprecated in favor of ip-address. So I've made the small changes to work with the new API. The tests pass so hopefully all is well.
1 parent 058fa3e commit bc5b56f

File tree

3 files changed

+983
-227
lines changed

3 files changed

+983
-227
lines changed

anon.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#!/usr/bin/env node
22

3-
const fs = require('fs')
4-
const ipv6 = require('ipv6')
5-
const Twit = require('twit')
6-
const async = require('async')
7-
const phantom = require('phantom')
8-
const minimist = require('minimist')
9-
const Mastodon = require('mastodon')
10-
const Mustache = require('mustache')
11-
const {WikiChanges} = require('wikichanges')
3+
const fs = require('fs')
4+
const Twit = require('twit')
5+
const async = require('async')
6+
const phantom = require('phantom')
7+
const minimist = require('minimist')
8+
const Mastodon = require('mastodon')
9+
const Mustache = require('mustache')
10+
const {WikiChanges} = require('wikichanges')
11+
const {Address4, Address6} = require('ip-address')
1212

1313
const argv = minimist(process.argv.slice(2), {
1414
default: {
@@ -19,12 +19,12 @@ const argv = minimist(process.argv.slice(2), {
1919

2020
function address(ip) {
2121
if (Array.from(ip).includes(':')) {
22-
return new ipv6.v6.Address(ip)
22+
return new Address6(ip)
2323
} else {
24-
i = new ipv6.v4.Address(ip)
24+
i = new Address4(ip)
2525
const subnetMask = 96 + i.subnetMask
26-
ip = `::ffff:${i.toV6Group()}/${subnetMask}`
27-
return new ipv6.v6.Address(ip)
26+
ip = `::ffff:${i.toGroup6()}/${subnetMask}`
27+
return new Address6(ip)
2828
}
2929
}
3030

0 commit comments

Comments
 (0)