Files
agency/.pnpm-store/v3/files/4d/2270e43b4eae307551a1b77b724d4a5425b90e55d78d18853e8b228dd4c1f5e1b1cca8cfbcec56db79e369ecab0fda6950697654a34e69c48b0b6f4fe061e2
hanzo-agent 5af6960b87 run project
Run: sess_f37640604ae254cb4d11dc6217f7b721
2026-09-30 00:04:56 +00:00

24 lines
546 B
Plaintext

/**
* @fileoverview Shared utilities for error messages.
* @author Josh Goldberg
*/
"use strict";
/**
* Converts a value to a string that may be printed in errors.
* @param {any} value The invalid value.
* @param {number} indentation How many spaces to indent
* @returns {string} The value, stringified.
*/
function stringifyValueForError(value, indentation) {
return value
? JSON.stringify(value, null, 4).replace(
/\n/gu,
`\n${" ".repeat(indentation)}`,
)
: `${value}`;
}
module.exports = { stringifyValueForError };