Deduplicate string compare utility (#9579)
This commit is contained in:
parent
436146105e
commit
e66027cd0c
9 changed files with 9 additions and 18 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue