MCPcopy Create free account
hub / github.com/github/gh-aw / processItems

Function processItems

actions/setup/js/safe_output_processor.cjs:294–306  ·  view source on GitHub ↗

* Process items through the standard pipeline: filter by allowed, filter blocked, sanitize, dedupe, limit * @param {any[]} rawItems - Raw items array from agent output * @param {string[]|undefined} allowed - Allowed items list * @param {number} maxCount - Maximum number of items * @param {string

(rawItems, allowed, maxCount, blocked = undefined)

Source from the content-addressed store, hash-verified

292 * @returns {string[]} Processed items
293 */
294function processItems(rawItems, allowed, maxCount, blocked = undefined) {
295 // Filter by allowed list first
296 const filtered = filterByAllowed(rawItems, allowed);
297
298 // Filter out blocked items
299 const notBlocked = filterByBlocked(filtered, blocked);
300
301 // Sanitize and deduplicate
302 const sanitized = sanitizeItems(notBlocked);
303
304 // Limit to max count
305 return limitToMaxCount(sanitized, maxCount);
306}
307
308module.exports = {
309 processSafeOutput,

Callers 3

assign_to_user.cjsFile · 0.85
mainFunction · 0.85

Calls 4

filterByAllowedFunction · 0.85
filterByBlockedFunction · 0.85
sanitizeItemsFunction · 0.85
limitToMaxCountFunction · 0.85

Tested by

no test coverage detected