FieldCollectionPipeline class exported ✓ 100.0%
Last updated: 2026-03-01T23:35:47.796Z
Metrics
LOC: 28
Complexity: 1
Params: 0
Coverage: 100.0% (9/9 lines, 0x executed)
Signature
class FieldCollectionPipeline
Summary
Orchestrates an ordered list of PageDetectors, running each one and aggregating their results into a single FormField array. Usage: const allFields = DEFAULT_COLLECTION_PIPELINE.run(); // add a new scanner const extended = DEFAULT_COLLECTION_PIPELINE.with(myPageDetector); // remove a scanner by name const noInteractive = DEFAULT_COLLECTION_PIPELINE.without("interactive-fields");
Source Code
export class FieldCollectionPipeline {
constructor(readonly detectors: ReadonlyArray<PageDetector>) {}
/** Run all detectors in order and return the concatenated list of fields. */
run(): FormField[] {
return this.detectors.flatMap((d) => d.detect());
}
/** Returns a new pipeline with the given detector appended. */
with(detector: PageDetector): FieldCollectionPipeline {
return new FieldCollectionPipeline([...this.detectors, detector]);
}
/** Returns a new pipeline excluding detectors with any of the given names. */
without(...names: string[]): FieldCollectionPipeline {
return new FieldCollectionPipeline(
this.detectors.filter((d) => !names.includes(d.name)),
);
}
/** Returns a new pipeline with detectors reordered by name. */
withOrder(names: string[]): FieldCollectionPipeline {
const ordered = names
.map((n) => this.detectors.find((d) => d.name === n))
.filter((d): d is PageDetector => d !== undefined);
return new FieldCollectionPipeline(ordered);
}
}
Members
| Name | Kind | Visibility | Status | Signature |
|---|---|---|---|---|
| constructor | method | - | constructor(readonly detectors: ReadonlyArray<PageDetector>) | |
| run | method | - | run(): : FormField[] | |
| with | method | - | with(detector: PageDetector): : FieldCollectionPipeline | |
| without | method | - | without(...names: string[]): : FieldCollectionPipeline | |
| withOrder | method | - | withOrder(names: string[]): : FieldCollectionPipeline |
No outgoing dependencies.
Impact (Incoming)
| Source | Type |
|---|---|
| getActiveClassifiers | uses |
| with | instantiates |
| without | instantiates |
| withOrder | instantiates |
| makeField | uses |