dns2 2.0.2 → 2.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dns2",
3
- "version": "2.0.2",
3
+ "version": "2.0.3",
4
4
  "description": "A DNS Server and Client Implementation in Pure JavaScript with no dependencies.",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/packet.js CHANGED
@@ -514,9 +514,10 @@ Packet.Resource.AAAA = {
514
514
  length -= 2;
515
515
  parts.push(reader.read(16));
516
516
  }
517
- this.address = parts.map(function(part) {
518
- return part > 0 ? part.toString(16) : '';
519
- }).join(':');
517
+ this.address = parts
518
+ .map(part => part > 0 ? part.toString(16) : '')
519
+ .join(':')
520
+ .replace('::::', '::');
520
521
  return this;
521
522
  },
522
523
  encode: function(record, writer) {
package/test/index.js CHANGED
@@ -112,7 +112,7 @@ test('Packet#encode', function() {
112
112
  type : Packet.TYPE.AAAA,
113
113
  class : Packet.CLASS.IN,
114
114
  ttl : 300,
115
- address : '2001:db8::::ff00:42:8329',
115
+ address : '2001:db8::ff00:42:8329',
116
116
  });
117
117
 
118
118
  response.answers.push({