tangerine 1.4.1 → 1.4.2

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.
Files changed (2) hide show
  1. package/index.js +10 -1
  2. package/package.json +2 -1
package/index.js CHANGED
@@ -7,7 +7,7 @@ const { debuglog } = require('node:util');
7
7
  const { getEventListeners, setMaxListeners } = require('node:events');
8
8
  const { isIP, isIPv4, isIPv6 } = require('node:net');
9
9
 
10
- const { toASCII } = require('punycode/');
10
+ const autoBind = require('auto-bind');
11
11
  const getStream = require('get-stream');
12
12
  const ipaddr = require('ipaddr.js');
13
13
  const mergeOptions = require('merge-options');
@@ -18,6 +18,8 @@ const packet = require('dns-packet');
18
18
  const semver = require('semver');
19
19
  const structuredClone = require('@ungap/structured-clone').default;
20
20
  const { getService } = require('port-numbers');
21
+ // eslint-disable-next-line import/order
22
+ const { toASCII } = require('punycode/');
21
23
 
22
24
  const pkg = require('./package.json');
23
25
 
@@ -363,6 +365,13 @@ class Tangerine extends dns.promises.Resolver {
363
365
 
364
366
  // manage set of abort controllers
365
367
  this.abortControllers = new Set();
368
+
369
+ //
370
+ // NOTE: bind methods so we don't have to programmatically call `.bind`
371
+ // (e.g. `getDmarcRecord(name, resolver.resolve.bind(resolver))`)
372
+ // (alternative to `autoBind(this)` is `this[method] = this[method].bind(this)`)
373
+ //
374
+ autoBind(this);
366
375
  }
367
376
 
368
377
  setLocalAddress(ipv4, ipv6) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tangerine",
3
3
  "description": "Tangerine is the best Node.js drop-in replacement for dns.promises.Resolver using DNS over HTTPS (\"DoH\") via undici with built-in retries, timeouts, smart server rotation, AbortControllers, and caching support for multiple backends (with TTL and purge support).",
4
- "version": "1.4.1",
4
+ "version": "1.4.2",
5
5
  "author": "Forward Email (https://forwardemail.net)",
6
6
  "bugs": {
7
7
  "url": "https://github.com/forwardemail/tangerine/issues"
@@ -11,6 +11,7 @@
11
11
  ],
12
12
  "dependencies": {
13
13
  "@ungap/structured-clone": "^1.0.2",
14
+ "auto-bind": "4",
14
15
  "dns-packet": "^5.4.0",
15
16
  "dohdec": "^5.0.3",
16
17
  "get-stream": "6",