@study-lenses/tracing
    Preparing search index...

    Function trace

    • Traces code execution using the given tracer module.

      Parameters

      • tracerModule: TracerModule

        A valid TracerModule object

      • code: string

        The source code / input string to trace

      • Optionalconfig: unknown

        Optional config object with { meta?, options? } structure

      Returns Promise<readonly StepCore[]>

      Promise resolving to an array of trace steps

      Curryable: trace(tracerModule) returns a pre-bound function that accepts (code, config?). Use this to avoid repeating the tracer arg when tracing multiple snippets with the same tracer.

      All validation and config prep is SYNCHRONOUS — errors throw immediately. Only the final record() call is async.

      (sync) if tracerModule does not satisfy the contract

      (sync) if code is not a string

      (sync) if schema validation fails

      (sync) if verifyOptions constraint violated

      // Direct call
      const steps = await trace(myTracer, 'hello');

      // Curried — reuse tracer across calls
      const traceWith = trace(myTracer);
      const steps1 = await traceWith('hello');
      const steps2 = await traceWith('world', { options: { direction: 'rl' } });
    • Traces code execution using the given tracer module.

      Parameters

      Returns (code: string, config?: unknown) => Promise<readonly StepCore[]>

      Promise resolving to an array of trace steps

      Curryable: trace(tracerModule) returns a pre-bound function that accepts (code, config?). Use this to avoid repeating the tracer arg when tracing multiple snippets with the same tracer.

      All validation and config prep is SYNCHRONOUS — errors throw immediately. Only the final record() call is async.

      (sync) if tracerModule does not satisfy the contract

      (sync) if code is not a string

      (sync) if schema validation fails

      (sync) if verifyOptions constraint violated

      // Direct call
      const steps = await trace(myTracer, 'hello');

      // Curried — reuse tracer across calls
      const traceWith = trace(myTracer);
      const steps1 = await traceWith('hello');
      const steps2 = await traceWith('world', { options: { direction: 'rl' } });