Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
constructor(props: any) {
super(props);
this.state = {
sortBy: 'name',
sortDirection: SortDirection.ASC,
selectLabel: 'Select columns to show',
selectOptions: [
{ value: 'id', label: 'ID' },
{ value: 'memory', label: 'Memory' },
{ value: 'size', label: 'Size' },
{ value: 'type', label: 'Type' },
{ value: 'write_concurrency', label: 'Write concurrency' },
{ value: 'read_concurrency', label: 'Read concurrency' },
{ value: 'lookup_max', label: 'lookup max time' },
{ value: 'lookup_count', label: 'lookup count' },
{ value: 'insert_max', label: 'insert max time' },
{ value: 'insert_count', label: 'insert count' },
{ value: 'owner', label: 'Owner' },
{ value: 'heir', label: 'Heir' },
{ value: 'protection', label: 'Protection' }
],
sort(listOfObjects: Array<*>) {
if (this.state.sortDirection === SortDirection.ASC) {
return listOfObjects.sort(this.propComparatorASC(this.state.sortBy));
} else {
return listOfObjects.sort(this.propComparatorDESC(this.state.sortBy));
}
}