data-collectors
Version:
A collection of composable reduction operations for arbitrary streams of values
15 lines (14 loc) • 753 B
TypeScript
import { Collector, BaseCollector } from "../collector";
import { ToArrayCollector } from "../collections/toArray";
export declare class JoiningCollector extends BaseCollector<any, any[], string> implements Collector<any, any[], string> {
protected collector: ToArrayCollector<any>;
protected separator: string;
protected prefix: string;
protected suffix: string;
constructor(separator?: string, prefix?: string, suffix?: string);
supply(): any[];
accumulate(container: any[], item: any): void;
combine(container1: any[], container2: any[]): any[];
finish(container: any[]): string;
}
export declare function joining(separator?: string, prefix?: string, suffix?: string): Collector<any, any[], string>;