Skip to content

Commit d38ee1e

Browse files
committed
restore startsWith
1 parent 69e7841 commit d38ee1e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/compiler/core.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1729,8 +1729,8 @@ namespace ts {
17291729
}
17301730

17311731
/* @internal */
1732-
export function startsWith(str: string, prefix: string): boolean {
1733-
return str.indexOf(prefix) === 0;
1732+
export function startsWith(str: string, prefix: string | undefined): boolean {
1733+
return str.lastIndexOf(prefix, 0) === 0;
17341734
}
17351735

17361736
/* @internal */

0 commit comments

Comments
 (0)