diff --git a/dns.classes.js b/dns.classes.js index c0f5463..d758503 100644 --- a/dns.classes.js +++ b/dns.classes.js @@ -1,8 +1,12 @@ (function (exports) { 'use strict'; -exports.DNS_CLASSES = { +var classes = exports.DNS_CLASSES = { IN: 0x01 // 1 }; +// and in reverse +Object.keys(classes).forEach(function (key) { + classes[classes[key]] = key; +}); }('undefined' !== typeof window ? window : exports)); diff --git a/dns.types.js b/dns.types.js index 95aa872..7323e4f 100644 --- a/dns.types.js +++ b/dns.types.js @@ -1,7 +1,7 @@ (function (exports) { 'use strict'; -exports.DNS_TYPES = { +var types = exports.DNS_TYPES = { A: 0x01 // 1 , NS: 0x02 // 2 , CNAME: 0x05 // 5 @@ -13,5 +13,9 @@ exports.DNS_TYPES = { , SRV: 0x21 // 33 , ANY: 0xff // 255 }; +// and in reverse +Object.keys(types).forEach(function (key) { + types[types[key]] = key; +}); }('undefined' !== typeof window ? window : exports));