-
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.
feat: resolve nested env values in feature function
- Loading branch information
Showing
6 changed files
with
76 additions
and
8 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
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 +1,23 @@ | ||
export const getKeys = Object.keys as <T extends object>(obj: T) => Array<keyof T>; | ||
|
||
/** | ||
* Deep `keyof` of a nested object. INCLUDES root key as well as all nested. | ||
* | ||
* @example "a" | "b" | "nest" | "otherNest" | "nest.c" | "otherNest.c" | ||
*/ | ||
export type DeepKeyofPaths<T> = T extends object | ||
? { | ||
[K in keyof T]: `${Exclude<K, symbol>}${"" | `.${DeepKeyofPaths<T[K]>}`}`; | ||
}[keyof T] | ||
: never; | ||
|
||
/** | ||
* Deep `keyof` of a nested object. DOES NOT INCLUDE root key, only shows leaf nodes. | ||
* | ||
* @example "a" | "b" | "nest.c" | "otherNest.c" | ||
*/ | ||
export type DeepKeyofLeaves<T> = T extends object | ||
? { | ||
[K in keyof T]: `${Exclude<K, symbol>}${DeepKeyofLeaves<T[K]> extends never ? "" : `.${DeepKeyofLeaves<T[K]>}`}`; | ||
}[keyof T] | ||
: never; |
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