-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(types)!:
KeysRequired
-> RequiredKeys
Signed-off-by: Lexus Drumgold <[email protected]>
- Loading branch information
1 parent
512272d
commit 0c1f420
Showing
3 changed files
with
11 additions
and
9 deletions.
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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
/** | ||
* @file Type Definitions - KeysRequired | ||
* @module tutils/types/KeysRequired | ||
* @file Type Definitions - RequiredKeys | ||
* @module tutils/types/RequiredKeys | ||
*/ | ||
|
||
import type ObjectPlain from './object-plain' | ||
|
||
/** | ||
* Extracts all required keys from `T`. | ||
* | ||
* @template T - Object type | ||
* @todo support nested keys | ||
* | ||
* @template T - Object type to evaluate | ||
*/ | ||
type KeysRequired<T extends ObjectPlain> = Exclude< | ||
type RequiredKeys<T extends ObjectPlain> = Exclude< | ||
{ [K in keyof T]: T extends Record<K, T[K]> ? K : never }[keyof T], | ||
undefined | ||
> | ||
|
||
export type { KeysRequired as default } | ||
export type { RequiredKeys as default } |