-> Used optional chaining for accessing nested properties to avoid potential errors
-> Defined regular expressions and other frequently used values as constants for better readability.
-> Kept the isModule and isModuleMain as inline functions for clarity.
-> Used optional chaining for accessing nested properties to avoid potential errors -> Defined regular expressions and other frequently used values as constants for better readability. -> Kept the isModule and isModuleMain as inline functions for clarity.