MCPcopy Create free account
hub / github.com/Effect-TS/effect / withoutCause

Function withoutCause

packages/effect/src/chat/ChatError.ts:121–127  ·  view source on GitHub ↗
(json: unknown)

Source from the content-addressed store, hash-verified

119const cause = Schema.optional(Schema.Defect())
120
121const withoutCause = (json: unknown): unknown => {
122 if (Predicate.isObject(json) && "cause" in json) {
123 const { cause: _, ...rest } = json as Record<string, unknown>
124 return rest
125 }
126 return json
127}
128
129const reasonMessage = (reason: { readonly _tag: string; readonly detail?: string | undefined }): string =>
130 reason.detail === undefined ? reason._tag : `${reason._tag}: ${reason.detail}`

Callers 12

toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85
toJSONMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected