Skip to content

Commit f5fc9a6

Browse files
committed
Ignore internal wildcards
- Trying to escape internal wildcards was proving too troublesome
1 parent cdf9f30 commit f5fc9a6

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

services/apps/alcs/src/utils/search-helper.spec.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,6 @@ describe('formatStringToSearchStringWithWildCard', () => {
2222
expect(actualOutput).toBe(expectedOutput);
2323
});
2424

25-
test('should escape internal wildcards', () => {
26-
const input = 'mult%iple %words';
27-
const expectedOutput = 'mult\\%iple %words';
28-
const actualOutput = formatNameSearchString(input);
29-
expect(actualOutput).toBe(expectedOutput);
30-
});
31-
3225
test('should trim input and format string correctly', () => {
3326
const input = ' trimmed word ';
3427
const expectedOutput = 'trimmed word';

services/apps/alcs/src/utils/search-helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const formatNameSearchString = (input: string): string | null => {
1212
return null;
1313
}
1414

15-
return matches[1] + matches[2].replace('/%/g', `\\%`) + matches[3];
15+
return matches[1] + matches[2].replace(/%/g, '') + matches[3];
1616
})
1717
.join(' ');
1818
};

0 commit comments

Comments
 (0)