Removes permission patterns already shown as the rendered bash command Keeps distinct patterns visible in the permission card Adds tests for the pattern filtering behavior
5 lines
217 B
TypeScript
5 lines
217 B
TypeScript
export const getVisiblePermissionPatterns = (patterns: string[], renderedCommand: string): string[] => {
|
|
if (!renderedCommand) return patterns;
|
|
return patterns.filter((pattern) => pattern !== renderedCommand);
|
|
};
|