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

Function dictWatch

packages/effect/src/encoding/SchemaBinary.ts:3743–3751  ·  view source on GitHub ↗
(slot: DictSlot, value: string)

Source from the content-addressed store, hash-verified

3741}
3742
3743function dictWatch(slot: DictSlot, value: string) {
3744 if (slot.refs.has(value)) {
3745 slot.state = DICT_REFERENCING
3746 return
3747 }
3748 slot.refs.set(value, slot.values.length)
3749 slot.values.push(value)
3750 if (slot.values.length >= DICT_WATCH_LIMIT) slot.state = DICT_GAVE_UP
3751}
3752
3753function dictAdd(slot: DictSlot, value: string) {
3754 const values = slot.values

Callers 2

encodeStringFunction · 0.85
decodeStringFunction · 0.85

Calls 3

hasMethod · 0.65
setMethod · 0.65
pushMethod · 0.65

Tested by

no test coverage detected