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

Fix/2230 type instantiation excessively deep #2231

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix: improve OmitMerge performance with mapped type
  • Loading branch information
coolsoftwaretyler committed Dec 13, 2024
commit 8bf9b0f45ccd8143dd14a71f12daa3d2045f7278
4 changes: 3 additions & 1 deletion src/types/complex-types/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export interface ModelPropertiesDeclaration {
}

/** intersect two object types, but omit keys of B from A before doing so */
type OmitMerge<A, B> = Omit<A, keyof B> & B
type OmitMerge<A, B> = {
[K in keyof A as K extends keyof B ? never : K]: A[K]
} & B

/**
* Unmaps syntax property declarations to a map of { propName: IType }
Expand Down