Remove unused function

This commit is contained in:
Kanchalai Tanglertsampan 2016-10-13 15:09:26 -07:00
parent 5b4dfcc18f
commit 99e2219c4e

View File

@ -23,21 +23,6 @@ namespace ts {
// More efficient to create a collator once and use its `compare` than to call `a.localeCompare(b)` many times.
export const collator: { compare(a: string, b: string): number } = typeof Intl === "object" && typeof Intl.Collator === "function" ? new Intl.Collator() : undefined;
/**
* Use this function instead of calling "String.prototype.localeCompre". This function will preform appropriate check to make sure that
* "typeof Intl" is correct as there are reported issues #11110 nad #11339.
* @param a reference string to compare
* @param b string to compare against
* @param locales string of BCP 47 language tag or an array of string of BCP 47 language tag
* @param options an object of Intl.CollatorOptions to specify localeCompare properties
*/
export function localeCompare(a: string, b: string, locales?: string | string[], options?: Intl.CollatorOptions): number | undefined {
if (collator && String.prototype.localeCompare) {
return a.localeCompare(b, locales, options);
}
return undefined;
}
export function createMap<T>(template?: MapLike<T>): Map<T> {
const map: Map<T> = createObject(null); // tslint:disable-line:no-null-keyword