Function: matchesFilter()
Makaio Framework / bus-core / matchesFilter
Function: matchesFilter()
Section titled “Function: matchesFilter()”matchesFilter(
payload,filter):boolean
Defined in: ../../../packages/bus-core/src/utils/payload-filter.ts:105
Check if a payload matches all filter conditions.
All conditions are ANDed together - all must match for the filter to pass.
Parameters
Section titled “Parameters”payload
Section titled “payload”unknown
Message payload to check
filter
Section titled “filter”PayloadFilter
Filter specification with field paths and operators
Returns
Section titled “Returns”boolean
true if payload matches all filter conditions
Example
Section titled “Example”const payload = { agentId: 'agent-123', raw: { msg: { type: 'session_configured' } }, status: 'active',};
// All conditions must matchmatchesFilter(payload, { agentId: 'agent-123', 'raw.msg.type': 'session_configured',}); // true
// With operatorsmatchesFilter(payload, { status: { $in: ['active', 'pending'] },}); // true
matchesFilter(payload, { error: { $exists: false },}); // true (no error field)