Skip to content

refactor: extract Map combination logic into fileMapUtils#2

Open
jangus3636-crypto wants to merge 1 commit into
retomeier:mainfrom
jangus3636-crypto:refactor-file-map-combination-5802272732960229132
Open

refactor: extract Map combination logic into fileMapUtils#2
jangus3636-crypto wants to merge 1 commit into
retomeier:mainfrom
jangus3636-crypto:refactor-file-map-combination-5802272732960229132

Conversation

@jangus3636-crypto
Copy link
Copy Markdown

Extract the repeated logic for combining text and binary file maps into a shared utility function. This reduces code duplication and improves maintainability across multiple tool implementations and utility modules.

  • Added src/utils/fileMapUtils.ts with getCombinedFileMap and getAllFileKeys.
  • Refactored LintTool.ts, fileReaderTool.ts, revertFileTool.ts, smartFileEditorTool.ts, renameFolderTool.ts, fileSearchTool.ts, markdownUtils.ts, and diffGenerator.ts to use the new utilities.

Extract the repeated logic for combining text and binary file maps into a shared utility function. This reduces code duplication and improves maintainability across multiple tool implementations and utility modules.

- Added `src/utils/fileMapUtils.ts` with `getCombinedFileMap` and `getAllFileKeys`.
- Refactored `LintTool.ts`, `fileReaderTool.ts`, `revertFileTool.ts`, `smartFileEditorTool.ts`, `renameFolderTool.ts`, `fileSearchTool.ts`, `markdownUtils.ts`, and `diffGenerator.ts` to use the new utilities.

Co-authored-by: jangus3636-crypto <260055890+jangus3636-crypto@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant