MCPcopy Create free account
hub / github.com/dailydotdev/apps / toLogString

Function toLogString

packages/shared/src/lib/errors.ts:69–79  ·  view source on GitHub ↗
(value: unknown)

Source from the content-addressed store, hash-verified

67const maxLogErrorLength = 500;
68
69const toLogString = (value: unknown): string | undefined => {
70 if (typeof value === 'string' && value.trim().length > 0) {
71 return value.slice(0, maxLogErrorLength);
72 }
73
74 if (typeof value === 'number' || typeof value === 'boolean') {
75 return String(value);
76 }
77
78 return undefined;
79};
80
81/**
82 * An error in a shape that survives `JSON.stringify`. `Error` keeps its

Callers 1

getLogErrorDetailsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected