aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
Diffstat (limited to 'packages')
-rw-r--r--packages/idb-bridge/src/util/structuredClone.test.ts3
-rw-r--r--packages/idb-bridge/src/util/structuredClone.ts3
2 files changed, 6 insertions, 0 deletions
diff --git a/packages/idb-bridge/src/util/structuredClone.test.ts b/packages/idb-bridge/src/util/structuredClone.test.ts
index ed404c6be..352c2c30b 100644
--- a/packages/idb-bridge/src/util/structuredClone.test.ts
+++ b/packages/idb-bridge/src/util/structuredClone.test.ts
@@ -24,7 +24,10 @@ function checkClone(t: ExecutionContext, x: any): void {
test("structured clone", (t) => {
checkClone(t, "foo");
checkClone(t, [1, 2]);
+ checkClone(t, true);
+ checkClone(t, false);
checkClone(t, { x1: "foo" });
+ checkClone(t, { x1: true, x2: false });
checkClone(t, new Date());
checkClone(t, [new Date()]);
checkClone(t, undefined);
diff --git a/packages/idb-bridge/src/util/structuredClone.ts b/packages/idb-bridge/src/util/structuredClone.ts
index 4ba97dd7a..181e9ca0e 100644
--- a/packages/idb-bridge/src/util/structuredClone.ts
+++ b/packages/idb-bridge/src/util/structuredClone.ts
@@ -180,6 +180,9 @@ export function internalStructuredRevive(val: any): any {
if (typeof val === "string") {
return val;
}
+ if (typeof val === "boolean") {
+ return val;
+ }
if (!isPlainObject(val)) {
throw Error();
}