Skip to content

Commit

Permalink
feat: rules for dns4 and dns6
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddias committed Jan 22, 2017
1 parent 3b99a73 commit 1d4aa10
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,17 @@
},
"homepage": "https://github.com/whyrusleeping/js-mafmt#readme",
"devDependencies": {
"aegir": "^9.3.2",
"aegir": "^9.3.3",
"chai": "^3.5.0",
"pre-commit": "^1.2.2"
},
"dependencies": {
"multiaddr": "^2.1.3"
"multiaddr": "^2.2.0"
},
"contributors": [
"David Dias <daviddias.p@gmail.com>",
"Jeromy <jeromyj@gmail.com>",
"Jeromy Johnson <why@ipfs.io>",
"dignifiedquire <dignifiedquire@gmail.com>"
]
}
}
11 changes: 10 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,14 @@ const multiaddr = require('multiaddr')
/*
* Valid combinations
*/
const DNS = base('dns')
const DNS4 = base('dns4')
const DNS6 = base('dns6')
const DNS = or(
base('dns'),
DNS4,
DNS6
)

const IP = or(base('ip4'), base('ip6'))
const TCP = and(IP, base('tcp'))
const UDP = and(IP, base('udp'))
Expand Down Expand Up @@ -50,6 +57,8 @@ const IPFS = or(
)

exports.DNS = DNS
exports.DNS4 = DNS4
exports.DNS6 = DNS6
exports.IP = IP
exports.TCP = TCP
exports.UDP = UDP
Expand Down

0 comments on commit 1d4aa10

Please sign in to comment.