Procházet zdrojové kódy

fix(common): Add missing chars to normalizeString function

Closes #144
Michael Bromley před 6 roky
rodič
revize
f687cc87c5

+ 1 - 1
packages/common/src/normalize-string.spec.ts

@@ -23,7 +23,7 @@ describe('normalizeString()', () => {
     it('strips non-alphanumeric characters', () => {
         expect(normalizeString('hi!!!')).toBe('hi');
         expect(normalizeString('who? me?')).toBe('who me');
-        expect(normalizeString('!"£$%^&*()+[]{};:@#~?/,|\\><`¬')).toBe('');
+        expect(normalizeString('!"£$%^&*()+[]{};:@#~?/,|\\><`¬\'=')).toBe('');
     });
 
     it('allows a subset of non-alphanumeric characters to pass through', () => {

+ 1 - 1
packages/common/src/normalize-string.ts

@@ -8,6 +8,6 @@ export function normalizeString(input: string, spaceReplacer = ' '): string {
         .normalize('NFD')
         .replace(/[\u0300-\u036f]/g, '')
         .toLowerCase()
-        .replace(/[!"£$%^&*()+[\]{};:@#~?\\/,|><`¬]/g, '')
+        .replace(/[!"£$%^&*()+[\]{};:@#~?\\/,|><`¬'=]/g, '')
         .replace(/\s+/g, spaceReplacer);
 }