Skip to content

Commit 3bb56cc

Browse files
committed
Clean up usages of deprecated startsWith/endsWith helpers
1 parent 4c99db1 commit 3bb56cc

10 files changed

Lines changed: 47 additions & 51 deletions

File tree

src/vs/workbench/contrib/preferences/browser/preferencesEditor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,7 @@ class PreferencesRenderersController extends Disposable {
692692
if (nlpMetadata) {
693693
const sortedKeys = Object.keys(nlpMetadata.scoredResults).sort((a, b) => nlpMetadata.scoredResults[b].score - nlpMetadata.scoredResults[a].score);
694694
const suffix = '##' + key;
695-
data['nlpIndex'] = arrays.firstIndex(sortedKeys, key => strings.endsWith(key, suffix));
695+
data['nlpIndex'] = arrays.firstIndex(sortedKeys, key => key.endsWith(suffix));
696696
}
697697

698698
const settingLocation = this._findSetting(this.lastFilterResult, key);

src/vs/workbench/contrib/preferences/browser/settingsEditor2.ts

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,16 @@ import { Button } from 'vs/base/browser/ui/button/button';
1010
import { ITreeElement } from 'vs/base/browser/ui/tree/tree';
1111
import { Action } from 'vs/base/common/actions';
1212
import * as arrays from 'vs/base/common/arrays';
13-
import { Delayer, ThrottledDelayer, timeout, IntervalTimer } from 'vs/base/common/async';
13+
import { Delayer, IntervalTimer, ThrottledDelayer, timeout } from 'vs/base/common/async';
1414
import { CancellationToken, CancellationTokenSource } from 'vs/base/common/cancellation';
1515
import * as collections from 'vs/base/common/collections';
16+
import { fromNow } from 'vs/base/common/date';
1617
import { getErrorMessage, isPromiseCanceledError } from 'vs/base/common/errors';
18+
import { Emitter } from 'vs/base/common/event';
1719
import { Iterable } from 'vs/base/common/iterator';
1820
import { KeyCode } from 'vs/base/common/keyCodes';
1921
import { Disposable } from 'vs/base/common/lifecycle';
2022
import * as platform from 'vs/base/common/platform';
21-
import * as strings from 'vs/base/common/strings';
2223
import { isArray, withNullAsUndefined, withUndefinedAsNull } from 'vs/base/common/types';
2324
import { URI } from 'vs/base/common/uri';
2425
import 'vs/css!./media/settingsEditor2';
@@ -35,10 +36,10 @@ import { IProductService } from 'vs/platform/product/common/productService';
3536
import { IStorageService, StorageScope } from 'vs/platform/storage/common/storage';
3637
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
3738
import { badgeBackground, badgeForeground, contrastBorder, editorForeground } from 'vs/platform/theme/common/colorRegistry';
38-
import { attachStylerCallback, attachButtonStyler } from 'vs/platform/theme/common/styler';
39+
import { attachButtonStyler, attachStylerCallback } from 'vs/platform/theme/common/styler';
3940
import { IThemeService } from 'vs/platform/theme/common/themeService';
4041
import { IStorageKeysSyncRegistryService } from 'vs/platform/userDataSync/common/storageKeys';
41-
import { getUserDataSyncStore, IUserDataSyncService, SyncStatus, IUserDataAutoSyncService } from 'vs/platform/userDataSync/common/userDataSync';
42+
import { getUserDataSyncStore, IUserDataAutoSyncService, IUserDataSyncService, SyncStatus } from 'vs/platform/userDataSync/common/userDataSync';
4243
import { BaseEditor } from 'vs/workbench/browser/parts/editor/baseEditor';
4344
import { IEditorMemento, IEditorPane } from 'vs/workbench/common/editor';
4445
import { attachSuggestEnabledInputBoxStyler, SuggestEnabledInput } from 'vs/workbench/contrib/codeEditor/browser/suggestEnabledInput/suggestEnabledInput';
@@ -48,13 +49,11 @@ import { AbstractSettingRenderer, ISettingLinkClickEvent, ISettingOverrideClickE
4849
import { ISettingsEditorViewState, parseQuery, SearchResultIdx, SearchResultModel, SettingsTreeElement, SettingsTreeGroupChild, SettingsTreeGroupElement, SettingsTreeModel, SettingsTreeSettingElement } from 'vs/workbench/contrib/preferences/browser/settingsTreeModels';
4950
import { settingsTextInputBorder } from 'vs/workbench/contrib/preferences/browser/settingsWidgets';
5051
import { createTOCIterator, TOCTree, TOCTreeModel } from 'vs/workbench/contrib/preferences/browser/tocTree';
51-
import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, EXTENSION_SETTING_TAG, IPreferencesSearchService, ISearchProvider, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS } from 'vs/workbench/contrib/preferences/common/preferences';
52-
import { IEditorGroupsService, IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
52+
import { CONTEXT_SETTINGS_EDITOR, CONTEXT_SETTINGS_SEARCH_FOCUS, CONTEXT_TOC_ROW_FOCUS, EXTENSION_SETTING_TAG, IPreferencesSearchService, ISearchProvider, MODIFIED_SETTING_TAG, SETTINGS_EDITOR_COMMAND_CLEAR_SEARCH_RESULTS, SETTINGS_EDITOR_COMMAND_SHOW_CONTEXT_MENU } from 'vs/workbench/contrib/preferences/common/preferences';
53+
import { IEditorGroup, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
5354
import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences';
5455
import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput';
5556
import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels';
56-
import { fromNow } from 'vs/base/common/date';
57-
import { Emitter } from 'vs/base/common/event';
5857

5958
function createGroupIterator(group: SettingsTreeGroupElement): Iterable<ITreeElement<SettingsTreeGroupChild>> {
6059
return Iterable.map(group.children, g => {
@@ -430,7 +429,7 @@ export class SettingsEditor2 extends BaseEditor {
430429
this.searchWidget = this._register(this.instantiationService.createInstance(SuggestEnabledInput, `${SettingsEditor2.ID}.searchbox`, searchContainer, {
431430
triggerCharacters: ['@'],
432431
provideResults: (query: string) => {
433-
return SettingsEditor2.SUGGESTIONS.filter(tag => query.indexOf(tag) === -1).map(tag => strings.endsWith(tag, ':') ? tag : tag + ' ');
432+
return SettingsEditor2.SUGGESTIONS.filter(tag => query.indexOf(tag) === -1).map(tag => tag.endsWith(':') ? tag : tag + ' ');
434433
}
435434
}, searchBoxLabel, 'settingseditor:searchinput' + SettingsEditor2.NUM_INSTANCES++, {
436435
placeholderText: searchBoxLabel,

src/vs/workbench/contrib/preferences/browser/settingsTree.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import { Emitter, Event } from 'vs/base/common/event';
2828
import { KeyCode } from 'vs/base/common/keyCodes';
2929
import { Disposable, DisposableStore, dispose } from 'vs/base/common/lifecycle';
3030
import { isIOS } from 'vs/base/common/platform';
31-
import { escapeRegExpCharacters, startsWith } from 'vs/base/common/strings';
31+
import { escapeRegExpCharacters } from 'vs/base/common/strings';
3232
import { isArray, isDefined, isUndefinedOrNull } from 'vs/base/common/types';
3333
import { localize } from 'vs/nls';
3434
import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService';
@@ -712,7 +712,7 @@ export abstract class AbstractSettingRenderer extends Disposable implements ITre
712712
const renderedMarkdown = renderMarkdown({ value: text, isTrusted: true }, {
713713
actionHandler: {
714714
callback: (content: string) => {
715-
if (startsWith(content, '#')) {
715+
if (content.startsWith('#')) {
716716
const e: ISettingLinkClickEvent = {
717717
source: element,
718718
targetKey: content.substr(1)

src/vs/workbench/contrib/preferences/common/preferencesContribution.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,26 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import * as nls from 'vs/nls';
7-
import { dispose, IDisposable, DisposableStore } from 'vs/base/common/lifecycle';
6+
import { DisposableStore, dispose, IDisposable } from 'vs/base/common/lifecycle';
87
import { isEqual } from 'vs/base/common/resources';
9-
import { endsWith } from 'vs/base/common/strings';
108
import { URI } from 'vs/base/common/uri';
119
import { ITextModel } from 'vs/editor/common/model';
1210
import { IModelService } from 'vs/editor/common/services/modelService';
1311
import { IModeService } from 'vs/editor/common/services/modeService';
1412
import { ITextModelService } from 'vs/editor/common/services/resolverService';
13+
import * as nls from 'vs/nls';
1514
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
15+
import { ConfigurationScope, Extensions, IConfigurationRegistry } from 'vs/platform/configuration/common/configurationRegistry';
1616
import { IEditorOptions, ITextEditorOptions } from 'vs/platform/editor/common/editor';
1717
import { IEnvironmentService } from 'vs/platform/environment/common/environment';
1818
import * as JSONContributionRegistry from 'vs/platform/jsonschemas/common/jsonContributionRegistry';
1919
import { Registry } from 'vs/platform/registry/common/platform';
2020
import { IWorkspaceContextService, WorkbenchState } from 'vs/platform/workspace/common/workspace';
2121
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
2222
import { IEditorInput } from 'vs/workbench/common/editor';
23-
import { IEditorService, IOpenEditorOverride } from 'vs/workbench/services/editor/common/editorService';
2423
import { IEditorGroup } from 'vs/workbench/services/editor/common/editorGroupsService';
24+
import { IEditorService, IOpenEditorOverride } from 'vs/workbench/services/editor/common/editorService';
2525
import { FOLDER_SETTINGS_PATH, IPreferencesService, USE_SPLIT_JSON_SETTING } from 'vs/workbench/services/preferences/common/preferences';
26-
import { Extensions, IConfigurationRegistry, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
2726

2827
const schemaRegistry = Registry.as<JSONContributionRegistry.IJSONContributionRegistry>(JSONContributionRegistry.Extensions.JSONContribution);
2928

@@ -68,7 +67,7 @@ export class PreferencesContribution implements IWorkbenchContribution {
6867
const resource = editor.resource;
6968
if (
7069
!resource ||
71-
!endsWith(resource.path, 'settings.json') || // resource must end in settings.json
70+
!resource.path.endsWith('settings.json') || // resource must end in settings.json
7271
!this.configurationService.getValue(USE_SPLIT_JSON_SETTING) // user has not disabled default settings editor
7372
) {
7473
return undefined;

src/vs/workbench/contrib/search/common/queryBuilder.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ export class QueryBuilder {
349349
const workspaceUri = this.workspaceContextService.getWorkspace().folders[0].uri;
350350

351351
searchPath = normalizeSlashes(searchPath);
352-
if (strings.startsWith(searchPath, '../') || searchPath === '..') {
352+
if (searchPath.startsWith('../') || searchPath === '..') {
353353
const resolvedPath = path.posix.resolve(workspaceUri.path, searchPath);
354354
return [{
355355
searchPath: workspaceUri.with({ path: resolvedPath })
@@ -400,7 +400,7 @@ export class QueryBuilder {
400400
pattern
401401
}];
402402

403-
if (pattern && !strings.endsWith(pattern, '**')) {
403+
if (pattern && !pattern.endsWith('**')) {
404404
results.push({
405405
searchPath: oneExpandedResult.searchPath,
406406
pattern: pattern + '/**'

src/vs/workbench/services/search/node/fileSearch.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -722,16 +722,16 @@ export function rgErrorMsgForDisplay(msg: string): string | undefined {
722722
const lines = msg.trim().split('\n');
723723
const firstLine = lines[0].trim();
724724

725-
if (strings.startsWith(firstLine, 'Error parsing regex')) {
725+
if (firstLine.startsWith('Error parsing regex')) {
726726
return firstLine;
727727
}
728728

729-
if (strings.startsWith(firstLine, 'regex parse error')) {
729+
if (firstLine.startsWith('regex parse error')) {
730730
return strings.uppercaseFirstLetter(lines[lines.length - 1].trim());
731731
}
732732

733-
if (strings.startsWith(firstLine, 'error parsing glob') ||
734-
strings.startsWith(firstLine, 'unsupported encoding')) {
733+
if (firstLine.startsWith('error parsing glob') ||
734+
firstLine.startsWith('unsupported encoding')) {
735735
// Uppercase first letter
736736
return firstLine.charAt(0).toUpperCase() + firstLine.substr(1);
737737
}
@@ -741,7 +741,7 @@ export function rgErrorMsgForDisplay(msg: string): string | undefined {
741741
return `Literal '\\n' currently not supported`;
742742
}
743743

744-
if (strings.startsWith(firstLine, 'Literal ')) {
744+
if (firstLine.startsWith('Literal ')) {
745745
// Other unsupported chars
746746
return firstLine;
747747
}

src/vs/workbench/services/search/node/rawSearchService.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,18 @@
55

66
import * as fs from 'fs';
77
import * as gracefulFs from 'graceful-fs';
8-
import { basename, dirname, join, sep } from 'vs/base/common/path';
98
import * as arrays from 'vs/base/common/arrays';
109
import { CancelablePromise, createCancelablePromise } from 'vs/base/common/async';
1110
import { CancellationToken } from 'vs/base/common/cancellation';
1211
import { canceled } from 'vs/base/common/errors';
1312
import { Emitter, Event } from 'vs/base/common/event';
13+
import { compareItemsByFuzzyScore, FuzzyScorerCache, IItemAccessor, prepareQuery } from 'vs/base/common/fuzzyScorer';
1414
import * as objects from 'vs/base/common/objects';
15+
import { basename, dirname, join, sep } from 'vs/base/common/path';
1516
import { StopWatch } from 'vs/base/common/stopwatch';
16-
import * as strings from 'vs/base/common/strings';
1717
import { URI, UriComponents } from 'vs/base/common/uri';
18-
import { compareItemsByFuzzyScore, IItemAccessor, prepareQuery, FuzzyScorerCache } from 'vs/base/common/fuzzyScorer';
1918
import { MAX_FILE_SIZE } from 'vs/base/node/pfs';
20-
import { ICachedSearchStats, IFileQuery, IFileSearchStats, IFolderQuery, IProgressMessage, IRawFileQuery, IRawQuery, IRawTextQuery, ITextQuery, IFileSearchProgressItem, IRawFileMatch, IRawSearchService, ISearchEngine, ISearchEngineSuccess, ISerializedFileMatch, ISerializedSearchComplete, ISerializedSearchProgressItem, ISerializedSearchSuccess, isFilePatternMatch } from 'vs/workbench/services/search/common/search';
19+
import { ICachedSearchStats, IFileQuery, IFileSearchProgressItem, IFileSearchStats, IFolderQuery, IProgressMessage, IRawFileMatch, IRawFileQuery, IRawQuery, IRawSearchService, IRawTextQuery, ISearchEngine, ISearchEngineSuccess, ISerializedFileMatch, ISerializedSearchComplete, ISerializedSearchProgressItem, ISerializedSearchSuccess, isFilePatternMatch, ITextQuery } from 'vs/workbench/services/search/common/search';
2120
import { Engine as FileSearchEngine } from 'vs/workbench/services/search/node/fileSearch';
2221
import { TextSearchEngineAdapter } from 'vs/workbench/services/search/node/textSearchAdapter';
2322

@@ -276,7 +275,7 @@ export class SearchService implements IRawSearchService {
276275
let cachedRow: ICacheRow | undefined;
277276
for (const previousSearch in cache.resultsToSearchCache) {
278277
// If we narrow down, we might be able to reuse the cached results
279-
if (strings.startsWith(searchValue, previousSearch)) {
278+
if (searchValue.startsWith(previousSearch)) {
280279
if (hasPathSep && previousSearch.indexOf(sep) < 0 && previousSearch !== '') {
281280
continue; // since a path character widens the search for potential more matches, require it in previous search too
282281
}

src/vs/workbench/services/search/node/ripgrepFileSearch.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ function globExprsToRgGlobs(patterns: glob.IExpression, folder?: string, exclude
131131

132132
// glob.ts requires forward slashes, but a UNC path still must start with \\
133133
// #38165 and #38151
134-
if (strings.startsWith(key, '\\\\')) {
134+
if (key.startsWith('\\\\')) {
135135
key = '\\\\' + key.substr(2).replace(/\\/g, '/');
136136
} else {
137137
key = key.replace(/\\/g, '/');
138138
}
139139

140140
if (typeof value === 'boolean' && value) {
141-
if (strings.startsWith(key, '\\\\')) {
141+
if (key.startsWith('\\\\')) {
142142
// Absolute globs UNC paths don't work properly, see #58758
143143
key += '**';
144144
}

src/vs/workbench/services/search/node/ripgrepSearchUtils.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,16 @@
33
* Licensed under the MIT License. See License.txt in the project root for license information.
44
*--------------------------------------------------------------------------------------------*/
55

6-
import { startsWith } from 'vs/base/common/strings';
7-
import { ILogService } from 'vs/platform/log/common/log';
8-
import { SearchRange, TextSearchMatch } from 'vs/workbench/services/search/common/search';
96
import { mapArrayOrNot } from 'vs/base/common/arrays';
107
import { URI } from 'vs/base/common/uri';
8+
import { ILogService } from 'vs/platform/log/common/log';
9+
import { SearchRange, TextSearchMatch } from 'vs/workbench/services/search/common/search';
1110
import * as searchExtTypes from 'vs/workbench/services/search/common/searchExtTypes';
1211

1312
export type Maybe<T> = T | null | undefined;
1413

1514
export function anchorGlob(glob: string): string {
16-
return startsWith(glob, '**') || startsWith(glob, '/') ? glob : `/${glob}`;
15+
return glob.startsWith('**') || glob.startsWith('/') ? glob : `/${glob}`;
1716
}
1817

1918
/**

src/vs/workbench/services/search/node/ripgrepTextSearchEngine.ts

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,19 @@
55

66
import * as cp from 'child_process';
77
import { EventEmitter } from 'events';
8-
import * as path from 'vs/base/common/path';
98
import { StringDecoder } from 'string_decoder';
10-
import { createRegExp, startsWith, startsWithUTF8BOM, stripUTF8BOM, escapeRegExpCharacters, endsWith } from 'vs/base/common/strings';
9+
import { coalesce } from 'vs/base/common/arrays';
10+
import { CancellationToken } from 'vs/base/common/cancellation';
11+
import { groupBy } from 'vs/base/common/collections';
12+
import { splitGlobAware } from 'vs/base/common/glob';
13+
import * as path from 'vs/base/common/path';
14+
import { createRegExp, escapeRegExpCharacters, startsWithUTF8BOM, stripUTF8BOM } from 'vs/base/common/strings';
1115
import { URI } from 'vs/base/common/uri';
16+
import { Progress } from 'vs/platform/progress/common/progress';
1217
import { IExtendedExtensionSearchOptions, SearchError, SearchErrorCode, serializeSearchError } from 'vs/workbench/services/search/common/search';
18+
import { Range, TextSearchComplete, TextSearchContext, TextSearchMatch, TextSearchOptions, TextSearchPreviewOptions, TextSearchQuery, TextSearchResult } from 'vs/workbench/services/search/common/searchExtTypes';
1319
import { rgPath } from 'vscode-ripgrep';
1420
import { anchorGlob, createTextSearchResult, IOutputChannel, Maybe } from './ripgrepSearchUtils';
15-
import { coalesce } from 'vs/base/common/arrays';
16-
import { splitGlobAware } from 'vs/base/common/glob';
17-
import { groupBy } from 'vs/base/common/collections';
18-
import { TextSearchQuery, TextSearchOptions, TextSearchResult, TextSearchComplete, TextSearchPreviewOptions, TextSearchContext, TextSearchMatch, Range } from 'vs/workbench/services/search/common/searchExtTypes';
19-
import { Progress } from 'vs/platform/progress/common/progress';
20-
import { CancellationToken } from 'vs/base/common/cancellation';
2121

2222
// If vscode-ripgrep is in an .asar file, then the binary is unpacked.
2323
const rgDiskPath = rgPath.replace(/\bnode_modules\.asar\b/, 'node_modules.asar.unpacked');
@@ -125,7 +125,7 @@ export function rgErrorMsgForDisplay(msg: string): Maybe<SearchError> {
125125
const lines = msg.split('\n');
126126
const firstLine = lines[0].trim();
127127

128-
if (lines.some(l => startsWith(l, 'regex parse error'))) {
128+
if (lines.some(l => l.startsWith('regex parse error'))) {
129129
return new SearchError(buildRegexParseError(lines), SearchErrorCode.regexParseError);
130130
}
131131

@@ -134,17 +134,17 @@ export function rgErrorMsgForDisplay(msg: string): Maybe<SearchError> {
134134
return new SearchError(`Unknown encoding: ${match[1]}`, SearchErrorCode.unknownEncoding);
135135
}
136136

137-
if (startsWith(firstLine, 'error parsing glob')) {
137+
if (firstLine.startsWith('error parsing glob')) {
138138
// Uppercase first letter
139139
return new SearchError(firstLine.charAt(0).toUpperCase() + firstLine.substr(1), SearchErrorCode.globParseError);
140140
}
141141

142-
if (startsWith(firstLine, 'the literal')) {
142+
if (firstLine.startsWith('the literal')) {
143143
// Uppercase first letter
144144
return new SearchError(firstLine.charAt(0).toUpperCase() + firstLine.substr(1), SearchErrorCode.invalidLiteral);
145145
}
146146

147-
if (startsWith(firstLine, 'PCRE2: error compiling pattern')) {
147+
if (firstLine.startsWith('PCRE2: error compiling pattern')) {
148148
return new SearchError(firstLine, SearchErrorCode.regexParseError);
149149
}
150150

@@ -153,7 +153,7 @@ export function rgErrorMsgForDisplay(msg: string): Maybe<SearchError> {
153153

154154
export function buildRegexParseError(lines: string[]): string {
155155
let errorMessage: string[] = ['Regex parse error'];
156-
let pcre2ErrorLine = lines.filter(l => (startsWith(l, 'PCRE2:')));
156+
let pcre2ErrorLine = lines.filter(l => (l.startsWith('PCRE2:')));
157157
if (pcre2ErrorLine.length >= 1) {
158158
let pcre2ErrorMessage = pcre2ErrorLine[0].replace('PCRE2:', '');
159159
if (pcre2ErrorMessage.indexOf(':') !== -1 && pcre2ErrorMessage.split(':').length >= 2) {
@@ -358,12 +358,12 @@ function getRgArgs(query: TextSearchQuery, options: TextSearchOptions): string[]
358358

359359
const { doubleStarIncludes, otherIncludes } = groupBy(
360360
options.includes,
361-
(include: string) => startsWith(include, '**') ? 'doubleStarIncludes' : 'otherIncludes');
361+
(include: string) => include.startsWith('**') ? 'doubleStarIncludes' : 'otherIncludes');
362362

363363
if (otherIncludes && otherIncludes.length) {
364364
const uniqueOthers = new Set<string>();
365365
otherIncludes.forEach(other => {
366-
if (!endsWith(other, '/**')) {
366+
if (!other.endsWith('/**')) {
367367
other += '/**';
368368
}
369369

0 commit comments

Comments
 (0)