MCPcopy
hub / github.com/prometheus/client_js / escapeLabelValue

Function escapeLabelValue

lib/registry.js:228–233  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

226 return flattened;
227}
228function escapeLabelValue(str) {
229 if (typeof str !== 'string') {
230 return str;
231 }
232 return escapeString(str).replace(/"/g, '\\"');
233}
234function escapeString(str) {
235 return str.replace(/\\/g, '\\\\').replace(/\n/g, '\\n');
236}

Callers 1

formatLabelsFunction · 0.85

Calls 1

escapeStringFunction · 0.85

Tested by

no test coverage detected