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

Function toKey

packages/effect/src/ui/Query.ts:3659–3671  ·  view source on GitHub ↗
(
    args: unknown,
    options: SchemaAST.ParseOptions
  )

Source from the content-addressed store, hash-verified

3657 const decodeArgs = SchemaParser.decodeUnknownEffect(argsJson)
3658 // `args` here is the encoded side of the args Schema, so these see the args as the declaration passes them.
3659 const toKey = (
3660 args: unknown,
3661 options: SchemaAST.ParseOptions
3662 ): Effect.Effect<string, SchemaIssue.Issue> =>
3663 Effect.flatMap(encodeArgs(args, options), (encoded) => {
3664 try {
3665 return Effect.succeed(canonical(encoded))
3666 } catch {
3667 return Effect.fail(
3668 invalid("the encoded args hold a value JSON can't carry")
3669 )
3670 }
3671 })
3672 const fromKey = (
3673 key: string,
3674 options: SchemaAST.ParseOptions

Callers 1

snapshotWireFunction · 0.70

Calls 5

encodeArgsFunction · 0.85
invalidFunction · 0.70
failMethod · 0.65
canonicalFunction · 0.50
succeedMethod · 0.45

Tested by

no test coverage detected