UNPKG

@it-corp/vpbank-spotlight

Version:

Command center components for react and VPbank components

29 lines (26 loc) 641 B
'use client'; import { isActionsGroup } from './is-actions-group.mjs'; function limitActions(actions, limit) { const result = []; if (!Array.isArray(actions)) { return []; } for (let i = 0; i < actions.length; i += 1) { const item = actions[i]; if (result.length >= limit) { return result; } if (isActionsGroup(item)) { result.push({ group: item.group, actions: limitActions(item.actions, limit - result.length) }); } if (!isActionsGroup(item)) { result.push(item); } } return result; } export { limitActions }; //# sourceMappingURL=limit-actions.mjs.map