From d38ee1eaf71fb6f92418ba5c2bf53b7b08366a17 Mon Sep 17 00:00:00 2001 From: Arthur Ozga Date: Wed, 3 May 2017 13:26:24 -0700 Subject: [PATCH] restore `startsWith` --- src/compiler/core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 6de1d62c14e..de560d89d40 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -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 */