MCPcopy Create free account
hub / github.com/bearlyai/OpenADE / matchesFilter

Function matchesFilter

projects/runtime-client/src/cache.ts:11–16  ·  view source on GitHub ↗
(runtime: RuntimeRecord, filter: RuntimeRecordCacheFilter = {})

Source from the content-addressed store, hash-verified

9const RUNTIME_RECORD_NOTIFICATION_METHODS = new Set(["runtime/created", "runtime/updated", "runtime/completed", "runtime/failed", "runtime/stopped"])
10
11function matchesFilter(runtime: RuntimeRecord, filter: RuntimeRecordCacheFilter = {}): boolean {
12 if (filter.ownerType !== undefined && runtime.scope.ownerType !== filter.ownerType) return false
13 if (filter.ownerId !== undefined && runtime.scope.ownerId !== filter.ownerId) return false
14 if (filter.status !== undefined && runtime.status !== filter.status) return false
15 return true
16}
17
18function sortByUpdatedAtDesc(a: RuntimeRecord, b: RuntimeRecord): number {
19 return b.updatedAt.localeCompare(a.updatedAt)

Callers 1

listMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected