"use strict";
/* Socket Lib - Built with rolldown */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const require_errors_predicates = require('./predicates.js');
let src_external_pony_cause = require("../external/pony-cause");

//#region src/errors/stack.ts
/**
* @file Stack-trace extractor with cause-chain support. `errorStack` returns
*   the cause-aware stack via pony-cause's `stackWithCauses` for Errors, and
*   `undefined` for non-Error values so callers can log conditionally.
*   `stackWithCauses` is re-exported for direct use.
*/
/**
* Extract a stack trace (with causes) from any caught value.
*
* Returns the cause-aware stack via {@link stackWithCauses} for Errors; returns
* `undefined` for non-Error values, so callers can `logger.error(msg, { stack:
* errorStack(e) })` safely.
*/
function errorStack(value) {
	if (require_errors_predicates.isError(value)) return (0, src_external_pony_cause.stackWithCauses)(value);
}

//#endregion
exports.errorStack = errorStack;
exports.stackWithCauses = src_external_pony_cause.stackWithCauses;