( state: RegistryState, oid: number, codec: Codec<A>, options?: RegisterOptions )
| 1590 | } |
| 1591 | |
| 1592 | const 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. |
no test coverage detected