Skip to content

Commit

Permalink
Update record coercer
Browse files Browse the repository at this point in the history
  • Loading branch information
arturmuller committed Nov 20, 2022
1 parent af0147d commit 8724dd2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/structs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,9 @@ export function record<K extends string, V>(
isObject(value) || `Expected an object, but received: ${print(value)}`
)
},
coercer(value) {
return isObject(value) ? { ...value } : value
},
})
}

Expand Down

0 comments on commit 8724dd2

Please sign in to comment.