ianstormtaylor / superstruct

A simple and composable way to validate data in JavaScript (and TypeScript).

Home Page:https://docs.superstructjs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected behaviour when combining `assign` + `refine`

john-rodewald opened this issue · comments

commented

I have an object-shaped struct that was created with refine and a custom validation handler. I want to extend this struct with additional fields. If I use assign, my validation handler seems to be skipped. Is this intended behaviour? If so, what is the proper way to do this?

I've created a minimal example to illustrate the issue I'm facing.

https://codesandbox.io/s/loving-sunset-zdvs6r?file=/index.js