@appsignal/plugin-breadcrumbs-console
Advanced tools
Comparing version 1.1.20 to 1.1.21
# AppSignal for plugin-breadcrumbs-console changelog | ||
## 1.1.21 | ||
### Changed | ||
- [60b3ee1](https://github.com/appsignal/appsignal-javascript/commit/60b3ee1d6478d03062c6b9c2896623ce1036c93a) patch - Serialise circular references in console arguments, omitting the cyclic value instead of throwing an error. | ||
- patch - Update @appsignal/javascript dependency to 1.3.20. | ||
## 1.1.20 | ||
@@ -4,0 +11,0 @@ |
@@ -39,16 +39,29 @@ "use strict"; | ||
function serializeValue(value, method) { | ||
if (typeof value === "string") { | ||
return value; | ||
switch (typeof value) { | ||
case "string": | ||
return value; | ||
case "undefined": | ||
return "undefined"; | ||
default: | ||
return JSON.stringify(value, circularReplacer()); | ||
} | ||
else { | ||
try { | ||
return JSON.stringify(value); | ||
} | ||
function circularReplacer() { | ||
var seenValue = []; | ||
var seenKey = []; | ||
return function (key, value) { | ||
if (typeof value === "object" && value !== null) { | ||
var i = seenValue.indexOf(value); | ||
if (i !== -1) { | ||
return "[cyclic value: " + (seenKey[i] || "root object") + "]"; | ||
} | ||
else { | ||
seenValue.push(value); | ||
seenKey.push(key); | ||
} | ||
} | ||
catch (error) { | ||
console.error("Could not serialize \"console." + method + "\" to String.", error); | ||
return "[Value could not be serialized]"; | ||
} | ||
} | ||
return value; | ||
}; | ||
} | ||
exports.plugin = consoleBreadcrumbsPlugin; | ||
//# sourceMappingURL=index.js.map |
@@ -36,16 +36,29 @@ var SUPPORTED_CONSOLE_METHODS = ["log", "debug", "info", "warn", "error"]; | ||
function serializeValue(value, method) { | ||
if (typeof value === "string") { | ||
return value; | ||
switch (typeof value) { | ||
case "string": | ||
return value; | ||
case "undefined": | ||
return "undefined"; | ||
default: | ||
return JSON.stringify(value, circularReplacer()); | ||
} | ||
else { | ||
try { | ||
return JSON.stringify(value); | ||
} | ||
function circularReplacer() { | ||
var seenValue = []; | ||
var seenKey = []; | ||
return function (key, value) { | ||
if (typeof value === "object" && value !== null) { | ||
var i = seenValue.indexOf(value); | ||
if (i !== -1) { | ||
return "[cyclic value: " + (seenKey[i] || "root object") + "]"; | ||
} | ||
else { | ||
seenValue.push(value); | ||
seenKey.push(key); | ||
} | ||
} | ||
catch (error) { | ||
console.error("Could not serialize \"console." + method + "\" to String.", error); | ||
return "[Value could not be serialized]"; | ||
} | ||
} | ||
return value; | ||
}; | ||
} | ||
export var plugin = consoleBreadcrumbsPlugin; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@appsignal/plugin-breadcrumbs-console", | ||
"version": "1.1.20", | ||
"version": "1.1.21", | ||
"main": "dist/cjs/index.js", | ||
@@ -25,3 +25,3 @@ "module": "dist/esm/index.js", | ||
"dependencies": { | ||
"@appsignal/javascript": "=1.3.19" | ||
"@appsignal/javascript": "=1.3.20" | ||
}, | ||
@@ -28,0 +28,0 @@ "devDependencies": { |
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
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
16123
139
1