Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function findGroupOrCreate(group, action) {
let groupNode = select(`group[name=${group}]`, action);
if (groupNode) {
return groupNode;
}
groupNode = createGroup({ name: group });
action.children.push(groupNode);
return groupNode;
}