-
-
Notifications
You must be signed in to change notification settings - Fork 196
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
Streamline Logic and Error Handling in configLoad.ts
#132
Comments
@Mefisto04
Could you provide some more detailed code snippets or pseudo-code for these improvements? Thank you again for your thoughtful suggestions. |
My initial thoughts are:
Let me know if this approach makes sense |
@yamadashy please review this and assign this if it works fine |
Thank you for your detailed suggestions and clarifications, @Mefisto04. |
The code in
src/config/configLoad.ts
can be optimized for better efficiency. Suggested improvements include:Parallelize File Checks: Execute the local and global configuration file existence checks in parallel using
Promise.all
to reduce execution time.Refactor
mergeConfigs
Function: Simplify the merging logic by using helper functions andArray.prototype.flat()
to avoid repetitive code.Enhance Error Handling: Consolidate error handling in
loadAndValidateConfig
to make the code more concise and maintainable.Implementing these changes will enhance code efficiency without affecting existing functionality.
The text was updated successfully, but these errors were encountered: