Node TAP
    Preparing search index...

    Variable captureFn

    captureFn: <F extends (this: any, ...a: any[]) => any>(
        original: F,
    ) => F & {
        args: () => TupleUnion<FilterUnknown<OverloadParamsTuple<F>>>[];
        calls: CaptureResult<F>[];
    }

    Type Declaration

      • <F extends (this: any, ...a: any[]) => any>(
            original: F,
        ): F & {
            args: () => TupleUnion<FilterUnknown<OverloadParamsTuple<F>>>[];
            calls: CaptureResult<F>[];
        }
      • Just wrap the function and return it. Does not have any logic to restore, since it's not actually modifying anything. The results hang off the function as the 'calls' property.

        The added fn.args() method will return an array of the arguments passed to each call since the last time it was inspected.

        Type Parameters

        • F extends (this: any, ...a: any[]) => any

        Parameters

        • original: F

        Returns F & {
            args: () => TupleUnion<FilterUnknown<OverloadParamsTuple<F>>>[];
            calls: CaptureResult<F>[];
        }