-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(typings): queryInterface.addIndex (#11844)
- Loading branch information
1 parent
fbd19d9
commit 365d7c3
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/** | ||
* Full credits to sindresorhus/type-fest | ||
* | ||
* https://github.com/sindresorhus/type-fest/blob/v0.8.1/source/set-required.d.ts | ||
* | ||
* Thank you! | ||
*/ | ||
export type SetRequired<BaseType, Keys extends keyof BaseType = keyof BaseType> = | ||
// Pick just the keys that are not required from the base type. | ||
Pick<BaseType, Exclude<keyof BaseType, Keys>> & | ||
// Pick the keys that should be required from the base type and make them required. | ||
Required<Pick<BaseType, Keys>> extends | ||
// If `InferredType` extends the previous, then for each key, use the inferred type key. | ||
infer InferredType | ||
? {[KeyType in keyof InferredType]: InferredType[KeyType]} | ||
: never; |