Skip to content
Myr

fix: Add missing type `current` for pre-TS 3.7 types

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by Michel Weststrate · committed by GitHub · parents 467ea5d, 04f8b52 · Browse files · 3 files+5 added−1 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+5 added−1 removed

  • other:+5 added−1 removed

3 files+5 added−1 removed

modified:compat/pre-3.7/dist/immer.d.ts+3 added
228 unmodified lines
229230/** Get the underlying object that is represented by the given draft */231export function original<T>(value: T): T | void232233/** 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. */234export function current<T>(value: T): T235236/** Returns true if the given value is an Immer draft */237export function isDraft(value: any): boolean238239/** Returns true if the given value can be drafted by Immer */
76 unmodified lines
modified:docs/current.md+1 added-1 removed
modified:src/core/current.ts+1 added