From 8724dd25880ffaf417bd1ea487506ba85a2d6ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Artur=20M=C3=BCller?= Date: Sun, 20 Nov 2022 13:25:15 +0100 Subject: [PATCH] Update record coercer --- src/structs/types.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/structs/types.ts b/src/structs/types.ts index 8bcc0ef3..7d69fd1a 100644 --- a/src/structs/types.ts +++ b/src/structs/types.ts @@ -366,6 +366,9 @@ export function record( isObject(value) || `Expected an object, but received: ${print(value)}` ) }, + coercer(value) { + return isObject(value) ? { ...value } : value + }, }) }