From 1d4aa10095d9ba38afd65d8ff2f53c129494150a Mon Sep 17 00:00:00 2001 From: David Dias Date: Sun, 22 Jan 2017 14:36:58 +0000 Subject: [PATCH] feat: rules for dns4 and dns6 --- package.json | 6 +++--- src/index.js | 11 ++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 9fc2911..de36054 100644 --- a/package.json +++ b/package.json @@ -33,12 +33,12 @@ }, "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 ", @@ -46,4 +46,4 @@ "Jeromy Johnson ", "dignifiedquire " ] -} \ No newline at end of file +} diff --git a/src/index.js b/src/index.js index ebc3e75..9153927 100644 --- a/src/index.js +++ b/src/index.js @@ -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')) @@ -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