Kind: Interface
Source: packages/core/discovery/discovery-service.ts
Part of: Core
FilterByInclude defines an inclusion filter used by the discovery service. Its include field contains predicate functions that determine which discovered items should be retained during discovery processing.
Properties
| Property | Type |
|---|---|
include | Function[] |
Diagram
mermaidgraph LR A[Discovery Service] --> B[FilterByInclude] B --> C[include: Function[]] C --> D[Inclusion Predicate 1] C --> E[Inclusion Predicate 2] D --> F[Discovered Items] E --> F F --> G[Included Results]
Usage
tsimport type { FilterByInclude } from './discovery-service';
const filter: FilterByInclude = {
include: [
(item) => item.enabled === true,
(item) => item.name.startsWith('api-'),
],
};
// Pass the filter to the discovery workflow.
// Only items matching the configured inclusion predicates are retained.
discoveryService.discover({
filter,
});
AI Coding Instructions
- Provide inclusion logic as functions in the
includearray; keep each predicate focused on a single filtering concern. - Ensure predicate functions safely handle missing or optional properties on discovered items.
- Use
FilterByIncludewhen configuring discovery behavior that should explicitly retain matching items. - Avoid placing side effects in include predicates; they should only evaluate whether an item belongs in the results.
Relationships
- IMPORTS →
CustomDecorator - IMPORTS →
flatten - IMPORTS →
Injectable - IMPORTS →
SetMetadata
Was this page helpful?