aboutsummaryrefslogtreecommitdiff
path: root/packages/bun-inspector-protocol/src/util/preview.ts
diff options
context:
space:
mode:
authorGravatar Ashcon Partovi <ashcon@partovi.net> 2023-08-25 11:53:21 -0700
committerGravatar Ashcon Partovi <ashcon@partovi.net> 2023-08-25 11:53:21 -0700
commit2c68e26d8dc99289092e42cbcef4c177544bf2da (patch)
tree1b31e72891d456d21171bcdb2397b851399cbaf0 /packages/bun-inspector-protocol/src/util/preview.ts
parent0731dfa0a42e719f3e3d736580c5709a43871670 (diff)
downloadbun-dap2.tar.gz
bun-dap2.tar.zst
bun-dap2.zip
Fix double quotes in console.log messagesdap2
Diffstat (limited to '')
-rw-r--r--packages/bun-inspector-protocol/src/util/preview.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/packages/bun-inspector-protocol/src/util/preview.ts b/packages/bun-inspector-protocol/src/util/preview.ts
index ad751a2b8..c6d748304 100644
--- a/packages/bun-inspector-protocol/src/util/preview.ts
+++ b/packages/bun-inspector-protocol/src/util/preview.ts
@@ -1,6 +1,6 @@
import type { JSC } from "../protocol";
-export function remoteObjectToString(remoteObject: JSC.Runtime.RemoteObject): string {
+export function remoteObjectToString(remoteObject: JSC.Runtime.RemoteObject, topLevel?: boolean): string {
const { type, subtype, value, description, className, preview } = remoteObject;
switch (type) {
case "undefined":
@@ -9,6 +9,9 @@ export function remoteObjectToString(remoteObject: JSC.Runtime.RemoteObject): st
case "number":
return description ?? JSON.stringify(value);
case "string":
+ if (topLevel) {
+ return String(value ?? description);
+ }
return JSON.stringify(value ?? description);
case "symbol":
case "bigint":