MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / pushToArrayProp

Function pushToArrayProp

packages/shared/src/utils.ts:126–135  ·  view source on GitHub ↗
(
    object: {[_ in K]?: T[]},
    key: K,
    value: T,
)

Source from the content-addressed store, hash-verified

124}
125
126export function pushToArrayProp<K extends PropertyKey, T>(
127 object: {[_ in K]?: T[]},
128 key: K,
129 value: T,
130): T[] {
131 let arr = object[key]
132 if (arr) arr.push(value)
133 else arr = object[key] = [value]
134 return arr
135}
136
137/** function that trims too long string */
138export function trimString(str: string, maxLength: number): string {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…