Skip to content

Commit

Permalink
fix: improve Buffer type handling in input-generators.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
1 parent e5c771c commit 68638b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/helpers/src/input-generators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ function findSelectorInCleanContent(
selector: string,
positionMap: Map<number, number>,
): { selector: string; originalIndex: number } {
// Convert cleanContent to Buffer to ensure consistent type handling
const cleanBuffer = Buffer.from(cleanContent);
// Convert cleanContent to Buffer for consistent type handling
const cleanBuffer: Buffer = Buffer.from(cleanContent);

// First build a clean string without soft line breaks
const cleanString = cleanBuffer.toString();
Expand Down Expand Up @@ -190,7 +190,7 @@ function getAdjustedSelector(
*/
function removeSoftLineBreaks(body: Uint8Array): { cleanContent: Uint8Array; positionMap: Map<number, number> } {
// Convert to Buffer for consistent handling
const bodyBuffer = Buffer.from(body);
const bodyBuffer: Buffer = Buffer.from(body);
const result: number[] = [];
const positionMap = new Map<number, number>(); // clean -> original
let i = 0;
Expand Down

0 comments on commit 68638b4

Please sign in to comment.