mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-18 07:29:16 -05:00
restore startsWith
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user