Skip to content

Commit

Permalink
Update tuple coercer
Browse files Browse the repository at this point in the history
  • Loading branch information
arturmuller committed Nov 20, 2022
1 parent 8724dd2 commit ee646b0
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 @@ -456,6 +456,9 @@ export function tuple<A extends AnyStruct, B extends AnyStruct[]>(
`Expected an array, but received: ${print(value)}`
)
},
coercer(value) {
return Array.isArray(value) ? value.slice() : value
},
})
}

Expand Down

0 comments on commit ee646b0

Please sign in to comment.