All files / packages/tools/src/store/ToolGroupManager getToolGroup.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 2/2
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15                    244x        
import { state } from '../index';
import { IToolGroup } from '../../types';
 
/**
 * Given a tool group Id, return the tool group
 * @param toolGroupId - The Id of the tool group to be retrieved.
 * @returns The tool group that has the same id as the tool group id that was
 * passed in.
 */
function getToolGroup(toolGroupId: string): IToolGroup | undefined {
  return state.toolGroups.find((s) => s.id === toolGroupId);
}
 
export default getToolGroup;