mirror of
https://github.com/laurent22/joplin.git
synced 2024-12-18 09:35:20 +02:00
02bdb7a79c
Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
12 lines
390 B
TypeScript
12 lines
390 B
TypeScript
// Some sources present licenses with different spacing.
|
|
// This function can be used to compare ignoring spaces.
|
|
const wordsMatch = (text1: string, text2: string) => {
|
|
const excludeRegex = /[ \t\n"]+/g;
|
|
text1 = text1.replace(excludeRegex, ' ').trim().toLowerCase();
|
|
text2 = text2.replace(excludeRegex, ' ').trim().toLowerCase();
|
|
|
|
return text1 === text2;
|
|
};
|
|
|
|
export default wordsMatch;
|