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

Function registerInState

packages/sql/pg/src/PgTypes.ts:1592–1603  ·  view source on GitHub ↗
(
  state: RegistryState,
  oid: number,
  codec: Codec<A>,
  options?: RegisterOptions
)

Source from the content-addressed store, hash-verified

1590}
1591
1592const registerInState = <A>(
1593 state: RegistryState,
1594 oid: number,
1595 codec: Codec<A>,
1596 options?: RegisterOptions
1597): void => {
1598 state.codecs.set(oid, toUnsafeCodec(codec))
1599 if (options?.arrayOid !== undefined) {
1600 state.elementToArray.set(oid, options.arrayOid)
1601 state.codecs.set(options.arrayOid, makeArrayCodec(oid, state.lookup))
1602 }
1603}
1604
1605/**
1606 * Creates a client-specific registry containing the built-in codecs.

Callers 1

makeRegistryFunction · 0.85

Calls 3

toUnsafeCodecFunction · 0.85
makeArrayCodecFunction · 0.85
setMethod · 0.65

Tested by

no test coverage detected