(other: AnagramComparator)
| 55 | } |
| 56 | |
| 57 | equals(other: AnagramComparator): boolean { |
| 58 | const cleanStr1 = this.word.replace(/ /g, '').toLowerCase() |
| 59 | const cleanStr2 = other.word.replace(/ /g, '').toLowerCase() |
| 60 | |
| 61 | const sortedStr1 = cleanStr1.split('').sort().join('') |
| 62 | const sortedStr2 = cleanStr2.split('').sort().join('') |
| 63 | |
| 64 | return sortedStr1 === sortedStr2 |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | function createAnagramComparator(word: string) { |
no test coverage detected