MCPcopy Index your code
hub / github.com/Effect-TS/effect / toStringUnknown

Function toStringUnknown

packages/effect/src/Inspectable.ts:207–216  ·  view source on GitHub ↗
(u: unknown, whitespace: number | string | undefined = 2)

Source from the content-addressed store, hash-verified

205 * @since 2.0.0
206 */
207export const toStringUnknown = (u: unknown, whitespace: number | string | undefined = 2): string => {
208 if (typeof u === "string") {
209 return u
210 }
211 try {
212 return typeof u === "object" ? stringifyCircular(u, whitespace) : String(u)
213 } catch {
214 return String(u)
215 }
216}
217
218/**
219 * @since 2.0.0

Callers 1

constructorFunction · 0.85

Calls 2

stringifyCircularFunction · 0.85
StringInterface · 0.85

Tested by

no test coverage detected