@logtape/pretty
Version:
Beautiful text formatter for LogTape—perfect for local development
12 lines (10 loc) • 309 B
text/typescript
export interface InspectOptions {
colors?: boolean;
depth?: number | null;
compact?: boolean;
[key: string]: unknown;
}
export function inspect(obj: unknown, options?: InspectOptions): string {
const indent = options?.compact === true ? undefined : 2;
return JSON.stringify(obj, null, indent);
}