( obj: T | null | undefined, key: K, value: V )
| 16 | * @returns A new object with the key/value merged. |
| 17 | */ |
| 18 | export function addToObject<T extends Record<string, any>, K extends string, V>( |
| 19 | obj: T | null | undefined, |
| 20 | key: K, |
| 21 | value: V |
| 22 | ): T & Record<K, V> { |
| 23 | return { |
| 24 | ...(obj || {}), |
| 25 | [key]: value, |
| 26 | } as T & Record<K, V>; |
| 27 | } |
nothing calls this directly
no outgoing calls
no test coverage detected