From 0966ebcffb51cda0e73657784a2aebaa9ca3f955 Mon Sep 17 00:00:00 2001 From: Richard Knoll Date: Tue, 5 Jul 2016 17:11:04 -0700 Subject: [PATCH] Removing startsWith reference and fixing linter error --- src/compiler/core.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/compiler/core.ts b/src/compiler/core.ts index 3fda91303f9..895a325cca6 100644 --- a/src/compiler/core.ts +++ b/src/compiler/core.ts @@ -941,7 +941,7 @@ namespace ts { * Regex for the ** wildcard. Matches any number of subdirectories. When used for including * files or directories, does not match subdirectories that start with a . character */ - const doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?" + const doubleAsteriskRegexFragment = usage === "exclude" ? "(/.+?)?" : "(/[^/.][^/]*)*?"; let pattern = ""; let hasWrittenSubpattern = false; @@ -987,11 +987,11 @@ namespace ts { // The * and ? wildcards should not match directories or files that start with . if they // appear first in a component. Dotted directories and files can be included explicitly // like so: **/.*/.* - if (startsWith(component, "*")) { + if (component.indexOf("*") === 0) { subpattern += "([^./]" + singleAsteriskRegexFragment + ")?"; component = component.substr(1); } - else if (startsWith(component, "?")) { + else if (component.indexOf("?") === 0) { subpattern += "[^./]"; component = component.substr(1); }