mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
restore startsWith
This commit is contained in:
1 parent
69e7841cda
commit
d38ee1eaf7
1 file changed
+2
-2
@@ -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