Add synchronous span helper

SU
11d ago
+106-1

Summary

  • add a synchronous withSyncSpan helper alongside withSpan
  • export it from the package entrypoint
  • cover synchronous callback execution, options, return values, and span completion

Verification

  • npm run typecheck
  • npx vitest run --pool=threads --poolOptions.threads.singleThread=true
  • npm run build

Summary by cubic

Adds a withSyncSpan helper that wraps synchronous callbacks in spans, matching the existing async withSpan behavior. The helper is exported from the package entrypoint, records errors on thrown callbacks, and throws a TypeError if the callback returns a Promise to steer callers toward withSpan. Covered by tests for callback execution, options, return values, error recording, and span completion.