(object: any, avoidGetters: string[] = [])
| 278 | } |
| 279 | |
| 280 | function captureObjectState(object: any, avoidGetters: string[] = []) { |
| 281 | const descriptors = Object.getOwnPropertyDescriptors(object); |
| 282 | const values = mapValues(descriptors, (_d, key) => { |
| 283 | if (avoidGetters.includes(key)) return descriptors[key].value; |
| 284 | return object[key]; |
| 285 | }); |
| 286 | return { |
| 287 | descriptors, |
| 288 | values, |
| 289 | }; |
| 290 | } |
| 291 | // Redefine all property descriptors and delete any new properties |
| 292 | function resetObject( |
| 293 | object: any, |
no outgoing calls
no test coverage detected
searching dependent graphs…