Found while porting pdfrx_engine text APIs to TypeScript, by code inspection.
packages/pdfrx_engine/lib/src/pdf_text.dart, PdfPageText.allMatches():
if (pattern is RegExp) {
caseInsensitive = pattern.isCaseSensitive; // <-- inverted naming
text = fullText;
} else if (pattern is String) {
pattern = caseInsensitive ? pattern.toLowerCase() : pattern;
text = caseInsensitive ? fullText.toLowerCase() : fullText;
}
The assignment caseInsensitive = pattern.isCaseSensitive is semantically inverted (isCaseSensitive == true would set caseInsensitive = true). It has no functional impact because caseInsensitive is never read after the RegExp branch (the RegExp handles its own case sensitivity), so this is dead-but-misleading code. Suggest removing the assignment (or, if it was meant to be surfaced somewhere, fixing the inversion).
Found while porting
pdfrx_enginetext APIs to TypeScript, by code inspection.packages/pdfrx_engine/lib/src/pdf_text.dart,PdfPageText.allMatches():The assignment
caseInsensitive = pattern.isCaseSensitiveis semantically inverted (isCaseSensitive == truewould setcaseInsensitive = true). It has no functional impact becausecaseInsensitiveis never read after the RegExp branch (the RegExp handles its own case sensitivity), so this is dead-but-misleading code. Suggest removing the assignment (or, if it was meant to be surfaced somewhere, fixing the inversion).