ThroughExtractorclass

new ThroughExtractor<I, O>(source: Extractor<I, O>)
ParamType
sourceExtractor<I, O>
The inner extractor to delegate to. required
Return
ThroughExtractor<I, O>
Base class for an extractor that wraps another extractor.
PropertyType
.sourceExtractor<I, O>
The wrapped source extractor this through extractor delegates to. required readonly

Base class for an extractor that wraps another extractor.

  • Subclasses delegate to source and (optionally) transform the input before or the output after.
  • Composes the same way Through*Provider chains do — chain multiple ThroughExtractors to build up behaviour.

Examples

new MergingExtractor(new DirectoryExtractor()) // a ThroughExtractor wrapping a source extractor

Methods

Go

ThroughExtractor.extract()method

Extract from the input by forwarding to source.extract().

extract(input: I): O | Promise<O>