-
-
Notifications
You must be signed in to change notification settings - Fork 108
Open
Description
Hi guys, thanks for this amazing library!
I wonder if there is a way how to extend predicates or compose a new one using a set of others.
Here is a use case:
interface User {
id: string;
email: string;
}
const assertUser = ow.create('User', ow.object.partialShape({
id: ow.string.nonEmpty,
email: ow.string.nonEmpty,
}))
interface Person extends User {
firstName: string;
lastName: string;
}
const assertPerson = ow.create('Person', ow.object.partialShape({
id: ow.string.nonEmpty,
email: ow.string.nonEmpty,
firstName: ow.string.nonEmpty,
lastName: ow.string.nonEmpty,
}))
I would love to be able to avoid code duplication.
Metadata
Metadata
Assignees
Labels
No labels