(
object: {[_ in K]?: T[]},
key: K,
value: T,
)
| 124 | } |
| 125 | |
| 126 | export 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 */ |
| 138 | export function trimString(str: string, maxLength: number): string { |
nothing calls this directly
no outgoing calls
no test coverage detected
searching dependent graphs…