We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
startsWith
1 parent 69e7841 commit d38ee1eCopy full SHA for d38ee1e
1 file changed
src/compiler/core.ts
@@ -1729,8 +1729,8 @@ namespace ts {
1729
}
1730
1731
/* @internal */
1732
- export function startsWith(str: string, prefix: string): boolean {
1733
- return str.indexOf(prefix) === 0;
+ export function startsWith(str: string, prefix: string | undefined): boolean {
+ return str.lastIndexOf(prefix, 0) === 0;
1734
1735
1736
0 commit comments