INNER CODE UNIT · TypeScript
safeInfo
EndBug/add-and-commit · src/util.ts:85
export function safeInfo(message: string): void {
// Direct core.info is forbidden elsewhere (no-restricted-syntax).
// eslint-disable-next-line no-restricted-syntax
core.info(neutralizeLogString(message));
}
const CIRCULAR_LOG_MARKER = '[Circular]';
/**
* Recursively neutralizes strings in values passed to log sinks (StatusSummary,
* commit results, Error messages, etc.).
* Tracks visited arrays/objects so circular references become a marker instead
* of overflowing the stack.
*/
export function neutralizeForLog(
value: unknown,
seen: WeakSet<object> = new WeakSet(),
): unknown {