Skip to content
Myr

feat: export isDraftable

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

For use by Immer-based libraries

authored by aleclarson · committed by aleclarson · parent d57433b · Browse files · 2 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

2 files+5 added−1 removed

  • other:+5 added−1 removed

2 files+5 added−1 removed

modified:src/immer.d.ts+4 added-1 removed
155 unmodified lines
156157/** Get the underlying object that is represented by the given draft */158export function original<T>(value: T): T | void159160/** For detecting an Immer draft */160/** Returns true if the given value is an Immer draft */161export function isDraft(value: any): boolean162163/** Returns true if the given value can be drafted by Immer */164export function isDraftable(value: any): boolean165166export class Immer {167 constructor(config: {168 useProxies?: boolean169 autoFreeze?: boolean
57 unmodified lines
modified:src/index.js+1 added