Skip to content

Commit 2e525a3

Browse files
committed
Replace strict equality operators with loose equality in search files features
- when comparing to strings use '==', not '==='
1 parent 4ad35fa commit 2e525a3

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

‎apps/editor/src/features/search-files/actions/search-files.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ export const search_files = async (params: {
188188
return undefined
189189
}
190190

191-
if (selected_items === 'intelligent') {
191+
if (selected_items == 'intelligent') {
192192
const intelligent_result = await perform_intelligent_search_flow({
193193
files: matched_files,
194194
workspace_provider: params.workspace_provider,

‎apps/editor/src/features/search-files/utils/prompt-for-intelligent-search-results.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export const prompt_for_intelligent_search_results = async (params: {
1616

1717
for (const extracted of params.extracted_files) {
1818
const matched = params.analysis.files_data.find(
19-
(f) => f.display_path === extracted
19+
(f) => f.display_path == extracted
2020
)
2121
if (matched) {
2222
absolute_paths.push(matched.file_path)
@@ -25,7 +25,7 @@ export const prompt_for_intelligent_search_results = async (params: {
2525
for (const root of roots) {
2626
const potential_abs = path.join(root, extracted)
2727
if (
28-
params.analysis.files_data.some((f) => f.file_path === potential_abs)
28+
params.analysis.files_data.some((f) => f.file_path == potential_abs)
2929
) {
3030
absolute_paths.push(potential_abs)
3131
break

‎apps/editor/src/features/search-files/utils/search-files-by-term.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const search_files_by_term = async (params: {
1818
}): Promise<string[]> => {
1919
const matched_files: string[] = []
2020

21-
if (params.search_mode === 'semantic') {
21+
if (params.search_mode == 'semantic') {
2222
const workspace_folders = vscode.workspace.workspaceFolders
2323
if (!workspace_folders) return []
2424

@@ -67,7 +67,7 @@ export const search_files_by_term = async (params: {
6767
.map((item) => item.file_path)
6868
}
6969

70-
if (params.search_mode === 'filename') {
70+
if (params.search_mode == 'filename') {
7171
const keywords = params.search_term
7272
.split(',')
7373
.map((k) => k.trim())

0 commit comments

Comments
 (0)