MCPcopy Create free account
hub / github.com/arktypeio/arktype / pushTo

Function pushTo

ark/aot/flat.ts:2526–2530  ·  view source on GitHub ↗
(map: Map<k, v[]>, key: k, value: v)

Source from the content-addressed store, hash-verified

2524}
2525
2526const pushTo = <k, v>(map: Map<k, v[]>, key: k, value: v) => {
2527 const values = map.get(key)
2528 if (values) values.push(value)
2529 else map.set(key, [value])
2530}
2531
2532// the comma separating two elements, past their parentheses and comments
2533const commaBetween = (

Callers 2

writeFlatFunction · 0.85
shareFailuresAsFunction · 0.85

Calls 3

getMethod · 0.65
pushMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected