-
-
Notifications
You must be signed in to change notification settings - Fork 41
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed
Description
Hi!
I just realised that if you extend a schema, e.g.
const WorkspaceSchema = Joi.object({
statistics:Joi.object({
views: Joi.number()
})
}).label('IWorkspace')
const ProjectSchema = WorkspaceSchema.keys({
statistics:Joi.object({
users:Joi.number()
})
}).label('IProject')
You end up with two interfaces:
export interface IWorkspace {
statistics: {
views: number;
};
}
and
export interface IProject {
statistics: {
users: number
}
}
Wouldn't it make more sense to extend IProject with IWorkspace?
export interface IProject extends IWorkspace {
statistics: {
users: number
}
}
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is needed