Remove default compareFn. According to docs: If compareFunction is not supplied, elements are sorted by converting them to strings and comparing strings in Unicode code point order.

This commit is contained in:
Kim Biesbjerg 2017-03-07 15:49:25 +01:00
parent f590b9bb9e
commit 994c31fb97

View File

@ -76,10 +76,6 @@ export class TranslationCollection {
}
public sort(compareFn?: (a: string, b: string) => number): TranslationCollection {
if (!compareFn) {
// If no compare function is provided use a case insensitive sorting function
compareFn = (a: string, b: string) => a.toLowerCase().localeCompare(b.toLowerCase());
}
let values: TranslationType = {};
this.keys().sort(compareFn).forEach((key) => {
values[key] = this.get(key);