in reverse also

This commit is contained in:
AJ ONeal 2017-01-21 13:35:06 -07:00
parent ae96f2fdc5
commit 98eb48dd34
2 changed files with 10 additions and 2 deletions

View File

@ -1,8 +1,12 @@
(function (exports) { (function (exports) {
'use strict'; 'use strict';
exports.DNS_CLASSES = { var classes = exports.DNS_CLASSES = {
IN: 0x01 // 1 IN: 0x01 // 1
}; };
// and in reverse
Object.keys(classes).forEach(function (key) {
classes[classes[key]] = key;
});
}('undefined' !== typeof window ? window : exports)); }('undefined' !== typeof window ? window : exports));

View File

@ -1,7 +1,7 @@
(function (exports) { (function (exports) {
'use strict'; 'use strict';
exports.DNS_TYPES = { var types = exports.DNS_TYPES = {
A: 0x01 // 1 A: 0x01 // 1
, NS: 0x02 // 2 , NS: 0x02 // 2
, CNAME: 0x05 // 5 , CNAME: 0x05 // 5
@ -13,5 +13,9 @@ exports.DNS_TYPES = {
, SRV: 0x21 // 33 , SRV: 0x21 // 33
, ANY: 0xff // 255 , ANY: 0xff // 255
}; };
// and in reverse
Object.keys(types).forEach(function (key) {
types[types[key]] = key;
});
}('undefined' !== typeof window ? window : exports)); }('undefined' !== typeof window ? window : exports));