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

Function value

packages/effect/src/internal/redacted.ts:7–16  ·  view source on GitHub ↗
(self: Redacted.Redacted<T>)

Source from the content-addressed store, hash-verified

5
6/** @internal */
7export const value = <T>(self: Redacted.Redacted<T>): T => {
8 if (redactedRegistry.has(self)) {
9 return redactedRegistry.get(self)
10 } else {
11 throw new Error(
12 "Unable to get redacted value" +
13 (self.label ? ` with label: "${self.label}"` : "")
14 )
15 }
16}
17
18/** @internal */
19export const stringOrRedacted = (val: string | Redacted.Redacted): string => typeof val === "string" ? val : value(val)

Callers 1

stringOrRedactedFunction · 0.70

Calls 2

getMethod · 0.65
hasMethod · 0.45

Tested by

no test coverage detected