(value: Draft<any>)
| 14 | /** Takes a snapshot of the current state of a draft and finalizes it (but without freezing). This is a great utility to print the current state during debugging (no Proxies in the way). The output of current can also be safely leaked outside the producer. */ |
| 15 | export function current<T>(value: Draft<T>): T |
| 16 | export function current(value: Draft<any>): any { |
| 17 | if (!isDraft(value)) die(10, value) |
| 18 | return currentImpl(value) |
| 19 | } |
| 20 | |
| 21 | function currentImpl(value: any): any { |
| 22 | if (!isDraftable(value) || isFrozen(value)) return value |
searching dependent graphs…