Comparing version 8.0.0 to 8.1.0
CHANGELOG | ||
========= | ||
## 8.1.0 (2020-9-25) | ||
* @maleblond Support multiple values for the same tag key | ||
## 8.0.0 (2020-9-23) | ||
* @naseemkullah Change default value for 'host' from 'localhost' to | ||
undefined. This should also 127.0.0.1 or ::1 to be used in the | ||
default case, which does look to speed things up. This should be a | ||
undefined. This means the default host will now be 127.0.0.1 or ::1, | ||
which has cases where it will speed up sending metrics. This should be a | ||
non-breaking change, but bumping to a major version for it given | ||
@@ -9,0 +12,0 @@ it's a very base change to the library. |
@@ -38,20 +38,23 @@ const fs = require('fs'); | ||
} else { | ||
childCopy[tag.substring(0, idx)] = tag.substring(idx + 1); | ||
const key = tag.substring(0, idx); | ||
const value = tag.substring(idx + 1); | ||
childCopy[key] = childCopy[key] || []; | ||
childCopy[key].push(value); | ||
} | ||
}); | ||
const result = parent.map(tag => { | ||
const result = parent.filter(tag => { | ||
const idx = typeof tag === 'string' ? tag.indexOf(':') : -1; | ||
if (idx < 1) { // Not found or first character | ||
return tag; | ||
return true; | ||
} | ||
const key = tag.substring(0, idx); | ||
if (childCopy.hasOwnProperty(key)) { | ||
const value = childCopy[key]; | ||
delete childCopy[key]; | ||
return `${key}:${value}`; | ||
} | ||
return tag; | ||
return !childCopy.hasOwnProperty(key); | ||
}); | ||
Object.keys(childCopy).forEach(key => { | ||
result.push(`${key}:${childCopy[key]}`); | ||
for (const value of childCopy[key]) { | ||
result.push(`${key}:${value}`); | ||
} | ||
}); | ||
@@ -58,0 +61,0 @@ return result.concat(toAppend); |
{ | ||
"name": "hot-shots", | ||
"description": "Node.js client for StatsD, DogStatsD, and Telegraf", | ||
"version": "8.0.0", | ||
"version": "8.1.0", | ||
"author": "Steve Ivy", | ||
@@ -6,0 +6,0 @@ "types": "./types.d.ts", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
80529