Repository navigation
refactor(@angular/cli): use static import for Module in update command - #34121
Conversation
Replace the inline dynamic require('node:module') call with a top-level static import of Module in UpdateCommandModule. Also update the _pathCache check to use the 'in' operator for safer property access and cleaner type narrowing.
There was a problem hiding this comment.
Code Review
This pull request replaces the dynamic require of 'node:module' with a static import of Module and updates the logic to clear Node's module resolution path cache. A review comment identifies a TypeScript compilation error where accessing '_pathCache' on the statically imported Module is not allowed because it is an internal, undocumented property. The reviewer suggests casting Module to a type that explicitly includes the optional '_pathCache' property to resolve the compilation error.
|
This PR was merged into the repository. The changes were merged into the following branches:
|
|
This pull request has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Replace the inline dynamic require('node:module') call with a top-level static import of Module in UpdateCommandModule. Also update the _pathCache check to use the 'in' operator for safer property access and cleaner type narrowing.