Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

omit, pick and partial should return schema's type #829

Closed
rozaxe opened this issue Jun 12, 2021 · 0 comments · Fixed by #1149
Closed

omit, pick and partial should return schema's type #829

rozaxe opened this issue Jun 12, 2021 · 0 comments · Fixed by #1149
Labels
bug ♥ help please Issues that we'd love help solving

Comments

@rozaxe
Copy link

rozaxe commented Jun 12, 2021

When passing a schema to omit, pick or partial, the resulting schema is always a struct object.()

It would be great to return the schema's type so that when passing a type(), the resulting schema is also a type().

Example:

const TodoSchema = type({
  id: string(),
  message: string()
})

const CreateTodoSchema = omit(TodoSchema, ['id'])
// CreateTodoSchema's is a struct 'object()' while it would great to keep it as a 'type' because it's input is.

I am willing to make the relevant PR if you want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ♥ help please Issues that we'd love help solving
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants