Comparing version 2.0.2 to 2.0.3
@@ -6,3 +6,3 @@ /* | ||
* | ||
* Copyright (c) 2018, Joyent, Inc. | ||
* Copyright 2021 Joyent, Inc. | ||
*/ | ||
@@ -185,4 +185,20 @@ | ||
/* | ||
* Exposition metric label values are quoted, and thus mus thave ", \, and | ||
* newline (\n) escaped. | ||
*/ | ||
var escapeLabelValue = function (s) { | ||
if (typeof (s) !== 'string') { | ||
return (s); | ||
} else { | ||
return (s | ||
.replace(/\u005c/g, '\\\\') // backslash | ||
.replace(/\u000a/g, '\\n') // newline | ||
.replace(/\u0022/g, '\\"')); // double quote | ||
} | ||
}; | ||
var appendLabel = function (key, value) { | ||
labelStr += mod_util.format('%s="%s",', key, value); | ||
labelStr += mod_util.format('%s="%s",', key, | ||
escapeLabelValue(value)); | ||
}; | ||
@@ -189,0 +205,0 @@ |
{ | ||
"name": "artedi", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "a metric client library", | ||
@@ -5,0 +5,0 @@ "main": "lib/collector.js", |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
61668
1437