@spfn/core 0.1.0-alpha.85 → 0.1.0-alpha.88

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/db/index.js CHANGED
@@ -133,7 +133,18 @@ function formatConsole(metadata, colorize = true) {
133
133
  }
134
134
  if (metadata.context && Object.keys(metadata.context).length > 0) {
135
135
  Object.entries(metadata.context).forEach(([key, value]) => {
136
- const valueStr = typeof value === "string" ? value : String(value);
136
+ let valueStr;
137
+ if (typeof value === "string") {
138
+ valueStr = value;
139
+ } else if (typeof value === "object" && value !== null) {
140
+ try {
141
+ valueStr = JSON.stringify(value);
142
+ } catch (error) {
143
+ valueStr = "[circular]";
144
+ }
145
+ } else {
146
+ valueStr = String(value);
147
+ }
137
148
  if (colorize) {
138
149
  parts.push(`${COLORS.dim}[${key}=${valueStr}]${COLORS.reset}`);
139
150
  } else {