MCPcopy Create free account
hub / github.com/anomalyco/opencode / optional

Function optional

packages/llm/src/route/auth.ts:87–90  ·  view source on GitHub ↗
(secret: Secret | undefined, source = "optional value")

Source from the content-addressed store, hash-verified

85export const value = (secret: string, source = "value") => credentialFromSecret(secret, source)
86
87export const optional = (secret: Secret | undefined, source = "optional value") =>
88 secret === undefined
89 ? credential(Effect.fail(new MissingCredentialError(source)))
90 : credentialFromSecret(secret, source)
91
92export const config = (name: string) => credentialFromSecret(Config.redacted(name), name)
93

Callers

nothing calls this directly

Calls 2

credentialFromSecretFunction · 0.85
credentialFunction · 0.70

Tested by

no test coverage detected