Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const GROUPS: {
name: string
defaultSize: number
key: (loc: Location) => string | undefined
}[] = [
{
name: 'repo',
defaultSize: 175,
key: loc => parseRepoURI(loc.uri).repoName,
},
]
const groupByFile =
this.props.settingsCascade.final &&
!isErrorLike(this.props.settingsCascade.final) &&
this.props.settingsCascade.final['panel.locations.groupByFile']
if (groupByFile) {
GROUPS.push({
name: 'file',
defaultSize: 200,
key: loc => parseRepoURI(loc.uri).filePath,
})
}
const { groups, selectedGroups, visibleLocations } = groupLocations(
this.state.locationsOrError.results || [],
this.state.selectedGroups || null,
GROUPS.map(({ key }) => key),
{ uri: this.props.defaultGroup }
)
const groupsToDisplay = GROUPS.map(({ name, key, defaultSize }, i) => {