nodemailer 6.6.4 → 6.6.5

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/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # CHANGELOG
2
2
 
3
+ ## 6.6.5 2021-09-23
4
+
5
+ - Replaced Object.values() and Array.flat() with polyfills to allow using Nodemailer in Node v6+
6
+
3
7
  ## 6.6.4 2021-09-22
4
8
 
5
9
  - Better compatibility with IPv6-only SMTP hosts (oxzi)
@@ -13,11 +13,16 @@ const os = require('os');
13
13
  const DNS_TTL = 5 * 60 * 1000;
14
14
 
15
15
  const resolver = (family, hostname, callback) => {
16
- const familySupported = Object.values(os.networkInterfaces()).
17
- flat().
18
- filter(i => !i.internal).
19
- filter(i => i.family === 'IPv' + family).
20
- length > 0;
16
+ const networkInterfaces = os.networkInterfaces();
17
+
18
+ const familySupported =
19
+ // crux that replaces Object.values(networkInterfaces) as Object.values is not supported in nodejs v6
20
+ Object.keys(networkInterfaces)
21
+ .map(key => networkInterfaces[key])
22
+ // crux that replaces .flat() as it is not supported in older Node versions (v10 and older)
23
+ .reduce((acc, val) => acc.concat(val), [])
24
+ .filter(i => !i.internal)
25
+ .filter(i => i.family === 'IPv' + family).length > 0;
21
26
 
22
27
  if (!familySupported) {
23
28
  return callback(null, []);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodemailer",
3
- "version": "6.6.4",
3
+ "version": "6.6.5",
4
4
  "description": "Easy as cake e-mail sending from your Node.js applications",
5
5
  "main": "lib/nodemailer.js",
6
6
  "scripts": {