deprecated export function _legacyBuildProcessorFunction ( chain , ... args ) { return chain . reduceRight ( ( next , fn ) => fn ( ... args ) ( next ) , ( doc ) => doc ) ; } export type ProcessorFunction < TParams = unknown , TInput = unknown , TOutput = TInput > = ( params : TParams ) => ( next : ( doc : TOutput ) => TOutput | Promise < TOutput > ) => ( doc : TInput ) => TOutput | Promise < TOutput > ; export const buildProcessorFunction = < TFunction extends Function = Function , TArgs = unknown , TResult = unknown > ( chain , args ) => chain . reduceRight ( ( next , fn ) => fn ( args ) ( next ) , ( doc ) => doc ) ;