Skip to content

Commit

Permalink
fix(moduleExec): actually return coerced values :)
Browse files Browse the repository at this point in the history
The previous `validateAndCoerceTypes()` would mutate the original object,
whereas `validateAndCoerceTypeBox()` returns a new object (which is
definitely better, but requires this little fix to make sure we actually
return the decoded types and don't just validate (like we do for "options",
for now).

cc: @eddie-atkinson
  • Loading branch information
gadicc committed Sep 17, 2024
1 parent f51f27f commit 94430d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/moduleExec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async function moduleExec<TOpts = unknown, TResult = unknown>(
* database, etc. Otherwise you'll receive an error.
*/
try {
validateAndCoerceTypebox({
return validateAndCoerceTypebox({
type: "result",
data: result,
schema: resultOpts.schema,
Expand Down

0 comments on commit 94430d8

Please sign in to comment.