()
| 1610 | * @since 4.0.0 |
| 1611 | */ |
| 1612 | export const makeRegistry = (): Registry => { |
| 1613 | const lookup: Lookup = (oid) => codecs.get(oid) |
| 1614 | const codecs = makeBuiltins(lookup) |
| 1615 | const state: RegistryState = { codecs, elementToArray: new Map(elementToArray), lookup } |
| 1616 | const registry: Registry = { |
| 1617 | register: (oid, codec, options) => registerInState(state, oid, codec, options) |
| 1618 | } |
| 1619 | registryStates.set(registry, state) |
| 1620 | return registry |
| 1621 | } |
| 1622 | |
| 1623 | const lookupFor = (registry: Registry | undefined): Lookup => |
| 1624 | registry === undefined ? lookup : getRegistryState(registry).lookup |
nothing calls this directly
no test coverage detected