-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance the diversification of configuration file reading
- enhance configuration reading so that it can read from .ctirc, package.json, and tsconfig.json. - enhance visibility of the source of configuration from .ctirc, package.json, or tsconfig.json.
- Loading branch information
Showing
17 changed files
with
504 additions
and
195 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,17 @@ | ||
export function getConfigObject( | ||
argv: Record<string, unknown>, | ||
...keywordArgs: string[] | ||
): Record<string, unknown> | undefined { | ||
const keywords = [...keywordArgs]; | ||
const keys = keywords.filter((keyword) => keyword in argv && argv[keyword] != null); | ||
|
||
if (keys.length <= 0) { | ||
return undefined; | ||
} | ||
|
||
const aggregated = keys.reduce<Record<string, unknown>>((obj, key) => { | ||
return { ...obj, [key]: argv[key] }; | ||
}, {}); | ||
|
||
return aggregated; | ||
} |
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
Oops, something went wrong.