( target: T, callback: (proxy: T) => void, )
| 1150 | * @returns The changes made to the object |
| 1151 | */ |
| 1152 | export function withChangeTracking<T extends object>( |
| 1153 | target: T, |
| 1154 | callback: (proxy: T) => void, |
| 1155 | ): Record<string | symbol, unknown> { |
| 1156 | const { proxy, getChanges } = createChangeProxy(target) |
| 1157 | |
| 1158 | callback(proxy) |
| 1159 | |
| 1160 | return getChanges() |
| 1161 | } |
| 1162 | |
| 1163 | /** |
| 1164 | * Creates proxies for an array of objects, passes them to a callback function, |
no test coverage detected
searching dependent graphs…