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

Infer timestamps option from schema #12731

Merged
merged 6 commits into from Nov 29, 2022
Merged

Infer timestamps option from schema #12731

merged 6 commits into from Nov 29, 2022

Conversation

vkarpov15
Copy link
Collaborator

Summary

Fix #12069

Adds { createdAt: Date, updatedAt: Date } if { timestamps: true } in schema options. Works great, the only potential problem is the expectType<{ createdAt: Date, updatedAt: Date } & { name?: string }>({} as WithTimestamps); weirdness - not sure if that is a problem, but it only seems to be an issue in tsd 🤷‍♂️

Examples

Copy link
Collaborator

@hasezoey hasezoey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vkarpov15 vkarpov15 merged commit c9ed03d into 6.8 Nov 29, 2022
@vkarpov15 vkarpov15 deleted the vkarpov15/gh-12069 branch November 29, 2022 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants