Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the PDF parsing and identification pipeline by passing the raw PDF text string directly instead of using intermediate structures like DocumentSource or ReadPdfResult. This simplifies document parsers and utility functions across the codebase. However, two issues were identified: first, RegExp.escape is used in questrade.ts but is not a standard JavaScript/TypeScript feature, which will cause runtime errors; second, an error message in calculate_file_names.ts still references the old fileNameByHash and info.hash variables and should be updated to reflect the refactoring.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| const lineRegex = RegExp( | ||
| "\\s" + RegExp.escape(this.#identifyingLine) + "\\s", | ||
| "i", | ||
| ); |
There was a problem hiding this comment.
RegExp.escape is not a standard JavaScript/TypeScript function (it is currently a Stage 3 ECMAScript proposal and not supported natively in standard environments). Using it will cause a runtime TypeError and a TypeScript compilation error. You should escape the special characters in this.#identifyingLine using a helper function or a simple regex replacement.
| const lineRegex = RegExp( | |
| "\\s" + RegExp.escape(this.#identifyingLine) + "\\s", | |
| "i", | |
| ); | |
| const escapedLine = this.#identifyingLine.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"); | |
| const lineRegex = RegExp( | |
| "\\s" + escapedLine + "\\s", | |
| "i", | |
| ); |
|
|
||
| for (const info of infoList) { | ||
| const newFileName = fileNameByHash.get(info.hash); | ||
| const newFileName = fileNameByPdf.get(info.pdf); |
No description provided.