restore startsWith

This commit is contained in:
Arthur Ozga
2017-05-03 13:26:24 -07:00
parent 69e7841cda
commit d38ee1eaf7

View File

@@ -1729,8 +1729,8 @@ namespace ts {
}
/* @internal */
export function startsWith(str: string, prefix: string): boolean {
return str.indexOf(prefix) === 0;
export function startsWith(str: string, prefix: string | undefined): boolean {
return str.lastIndexOf(prefix, 0) === 0;
}
/* @internal */