@opentelemetry/resources
Advanced tools
Comparing version 1.7.0 to 1.8.0
@@ -45,3 +45,3 @@ import { Resource } from '../Resource'; | ||
private _isValid; | ||
private _isPrintableString; | ||
private _isBaggageOctetString; | ||
/** | ||
@@ -48,0 +48,0 @@ * Determines whether the given String is a valid printable ASCII string with |
@@ -163,3 +163,3 @@ /* | ||
key = key.trim(); | ||
value = value.trim().split('^"|"$').join(''); | ||
value = value.trim().split(/^"|"$/).join(''); | ||
if (!this._isValidAndNotEmpty(key)) { | ||
@@ -171,3 +171,3 @@ throw new Error("Attribute key " + this._ERROR_MESSAGE_INVALID_CHARS); | ||
} | ||
attributes[key] = value; | ||
attributes[key] = decodeURIComponent(value); | ||
} | ||
@@ -192,8 +192,9 @@ } | ||
EnvDetector.prototype._isValid = function (name) { | ||
return name.length <= this._MAX_LENGTH && this._isPrintableString(name); | ||
return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); | ||
}; | ||
EnvDetector.prototype._isPrintableString = function (str) { | ||
// https://www.w3.org/TR/baggage/#definition | ||
EnvDetector.prototype._isBaggageOctetString = function (str) { | ||
for (var i = 0; i < str.length; i++) { | ||
var ch = str.charAt(i); | ||
if (ch <= ' ' || ch >= '~') { | ||
var ch = str.charCodeAt(i); | ||
if (ch < 0x21 || ch === 0x2C || ch === 0x3B || ch === 0x5C || ch > 0x7E) { | ||
return false; | ||
@@ -200,0 +201,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.7.0"; | ||
export declare const VERSION = "1.8.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export var VERSION = '1.7.0'; | ||
export var VERSION = '1.8.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -45,3 +45,3 @@ import { Resource } from '../Resource'; | ||
private _isValid; | ||
private _isPrintableString; | ||
private _isBaggageOctetString; | ||
/** | ||
@@ -48,0 +48,0 @@ * Determines whether the given String is a valid printable ASCII string with |
@@ -92,3 +92,3 @@ /* | ||
key = key.trim(); | ||
value = value.trim().split('^"|"$').join(''); | ||
value = value.trim().split(/^"|"$/).join(''); | ||
if (!this._isValidAndNotEmpty(key)) { | ||
@@ -100,3 +100,3 @@ throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); | ||
} | ||
attributes[key] = value; | ||
attributes[key] = decodeURIComponent(value); | ||
} | ||
@@ -113,8 +113,9 @@ return attributes; | ||
_isValid(name) { | ||
return name.length <= this._MAX_LENGTH && this._isPrintableString(name); | ||
return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); | ||
} | ||
_isPrintableString(str) { | ||
// https://www.w3.org/TR/baggage/#definition | ||
_isBaggageOctetString(str) { | ||
for (let i = 0; i < str.length; i++) { | ||
const ch = str.charAt(i); | ||
if (ch <= ' ' || ch >= '~') { | ||
const ch = str.charCodeAt(i); | ||
if (ch < 0x21 || ch === 0x2C || ch === 0x3B || ch === 0x5C || ch > 0x7E) { | ||
return false; | ||
@@ -121,0 +122,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.7.0"; | ||
export declare const VERSION = "1.8.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -17,3 +17,3 @@ /* | ||
// this is autogenerated file, see scripts/version-update.js | ||
export const VERSION = '1.7.0'; | ||
export const VERSION = '1.8.0'; | ||
//# sourceMappingURL=version.js.map |
@@ -45,3 +45,3 @@ import { Resource } from '../Resource'; | ||
private _isValid; | ||
private _isPrintableString; | ||
private _isBaggageOctetString; | ||
/** | ||
@@ -48,0 +48,0 @@ * Determines whether the given String is a valid printable ASCII string with |
@@ -95,3 +95,3 @@ "use strict"; | ||
key = key.trim(); | ||
value = value.trim().split('^"|"$').join(''); | ||
value = value.trim().split(/^"|"$/).join(''); | ||
if (!this._isValidAndNotEmpty(key)) { | ||
@@ -103,3 +103,3 @@ throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`); | ||
} | ||
attributes[key] = value; | ||
attributes[key] = decodeURIComponent(value); | ||
} | ||
@@ -116,8 +116,9 @@ return attributes; | ||
_isValid(name) { | ||
return name.length <= this._MAX_LENGTH && this._isPrintableString(name); | ||
return name.length <= this._MAX_LENGTH && this._isBaggageOctetString(name); | ||
} | ||
_isPrintableString(str) { | ||
// https://www.w3.org/TR/baggage/#definition | ||
_isBaggageOctetString(str) { | ||
for (let i = 0; i < str.length; i++) { | ||
const ch = str.charAt(i); | ||
if (ch <= ' ' || ch >= '~') { | ||
const ch = str.charCodeAt(i); | ||
if (ch < 0x21 || ch === 0x2C || ch === 0x3B || ch === 0x5C || ch > 0x7E) { | ||
return false; | ||
@@ -124,0 +125,0 @@ } |
@@ -1,2 +0,2 @@ | ||
export declare const VERSION = "1.7.0"; | ||
export declare const VERSION = "1.8.0"; | ||
//# sourceMappingURL=version.d.ts.map |
@@ -20,3 +20,3 @@ "use strict"; | ||
// this is autogenerated file, see scripts/version-update.js | ||
exports.VERSION = '1.7.0'; | ||
exports.VERSION = '1.8.0'; | ||
//# sourceMappingURL=version.js.map |
{ | ||
"name": "@opentelemetry/resources", | ||
"version": "1.7.0", | ||
"version": "1.8.0", | ||
"description": "OpenTelemetry SDK resources", | ||
@@ -64,4 +64,4 @@ "main": "build/src/index.js", | ||
"devDependencies": { | ||
"@opentelemetry/api": ">=1.0.0 <1.3.0", | ||
"@types/mocha": "9.1.1", | ||
"@opentelemetry/api": ">=1.0.0 <1.4.0", | ||
"@types/mocha": "10.0.0", | ||
"@types/node": "18.6.5", | ||
@@ -90,10 +90,11 @@ "@types/sinon": "10.0.13", | ||
"peerDependencies": { | ||
"@opentelemetry/api": ">=1.0.0 <1.3.0" | ||
"@opentelemetry/api": ">=1.0.0 <1.4.0" | ||
}, | ||
"dependencies": { | ||
"@opentelemetry/core": "1.7.0", | ||
"@opentelemetry/semantic-conventions": "1.7.0" | ||
"@opentelemetry/core": "1.8.0", | ||
"@opentelemetry/semantic-conventions": "1.8.0" | ||
}, | ||
"homepage": "https://github.com/open-telemetry/opentelemetry-js/tree/main/packages/opentelemetry-resources", | ||
"gitHead": "ad88c3d9aa0100fe259b93f4b660e84417b757ac" | ||
"sideEffects": false, | ||
"gitHead": "7972edf6659fb6e0d5928a5cf7a35f26683e168f" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
306459
3435
+ Added@opentelemetry/api@1.3.0(transitive)
+ Added@opentelemetry/core@1.8.0(transitive)
+ Added@opentelemetry/semantic-conventions@1.8.0(transitive)
- Removed@opentelemetry/api@1.2.0(transitive)
- Removed@opentelemetry/core@1.7.0(transitive)
- Removed@opentelemetry/semantic-conventions@1.7.0(transitive)
Updated@opentelemetry/core@1.8.0