Deduplicate string compare utility (#9579)

This commit is contained in:
Michael Telatynski
2022-11-15 10:20:36 +00:00
committed by GitHub
parent 436146105e
commit e66027cd0c
9 changed files with 9 additions and 18 deletions

View File

@@ -75,16 +75,6 @@ export function copyNode(ref: Element): boolean {
return document.execCommand('copy');
}
const collator = new Intl.Collator();
/**
* Performant language-sensitive string comparison
* @param a the first string to compare
* @param b the second string to compare
*/
export function compare(a: string, b: string): number {
return collator.compare(a, b);
}
/**
* Returns text which has been selected by the user
* @returns the selected text