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

Function primaryKey

packages/effect/src/unstable/cluster/Envelope.ts:409–418  ·  view source on GitHub ↗
(envelope: Envelope<R>)

Source from the content-addressed store, hash-verified

407 * @since 4.0.0
408 */
409export const primaryKey = <R extends Rpc.Any>(envelope: Envelope<R>): string | null => {
410 if (envelope._tag !== "Request" || !PrimaryKey.isPrimaryKey(envelope.payload)) {
411 return null
412 }
413 return primaryKeyByAddress({
414 address: envelope.address,
415 tag: envelope.tag,
416 id: PrimaryKey.value(envelope.payload)
417 })
418}
419
420/**
421 * Builds a storage primary-key string from an entity address, RPC tag, and

Callers

nothing calls this directly

Calls 2

primaryKeyByAddressFunction · 0.85
valueMethod · 0.45

Tested by

no test coverage detected