feat: rules for dns4 and dns6

This commit is contained in:
David Dias 2017-01-22 14:36:58 +00:00
parent 3b99a7335f
commit 1d4aa10095
2 changed files with 13 additions and 4 deletions

View File

@ -33,12 +33,12 @@
}, },
"homepage": "https://github.com/whyrusleeping/js-mafmt#readme", "homepage": "https://github.com/whyrusleeping/js-mafmt#readme",
"devDependencies": { "devDependencies": {
"aegir": "^9.3.2", "aegir": "^9.3.3",
"chai": "^3.5.0", "chai": "^3.5.0",
"pre-commit": "^1.2.2" "pre-commit": "^1.2.2"
}, },
"dependencies": { "dependencies": {
"multiaddr": "^2.1.3" "multiaddr": "^2.2.0"
}, },
"contributors": [ "contributors": [
"David Dias <daviddias.p@gmail.com>", "David Dias <daviddias.p@gmail.com>",

View File

@ -5,7 +5,14 @@ const multiaddr = require('multiaddr')
/* /*
* Valid combinations * 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 IP = or(base('ip4'), base('ip6'))
const TCP = and(IP, base('tcp')) const TCP = and(IP, base('tcp'))
const UDP = and(IP, base('udp')) const UDP = and(IP, base('udp'))
@ -50,6 +57,8 @@ const IPFS = or(
) )
exports.DNS = DNS exports.DNS = DNS
exports.DNS4 = DNS4
exports.DNS6 = DNS6
exports.IP = IP exports.IP = IP
exports.TCP = TCP exports.TCP = TCP
exports.UDP = UDP exports.UDP = UDP