


//#region src/logger/replaceError.ts
function replaceError(_, value) {
	/**
	* This special handling for error classes is mostly to not hide error messages in React Native.
	* The error serialization works differently from node, so a lot of times you get `error: {}`, which
	* really compliactes debugging.
	*/
	if (value instanceof Error) return {
		serialized: "toJSON" in value && typeof value.toJSON === "function" ? value.toJSON() : value.toString(),
		message: value.message,
		name: value.name,
		stack: value.stack
	};
	return value;
}

//#endregion
exports.replaceError = replaceError;