File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -128,13 +128,13 @@ const proxyHandler: ProxyHandler<ProxyDraft> = {
128128 ( value === peek ( target . original , key ) ||
129129 target . options . skipFinalization ! . has ( value ) )
130130 ) {
131- const has = target . options . skipFinalization ! . has ( value ) ;
132- if ( target . options . skipFinalization ! . has ( value ) ) {
131+ const shouldSkip = target . options . skipFinalization ! . has ( value ) ;
132+ if ( shouldSkip ) {
133133 target . options . skipFinalization ! . delete ( value ) ;
134134 }
135135 ensureShallowCopy ( target ) ;
136136 target . copy ! [ key ] = createDraft ( {
137- original : has ? target . copy ! [ key ] : target . original [ key ] ,
137+ original : shouldSkip ? target . copy ! [ key ] : target . original [ key ] ,
138138 parentDraft : target ,
139139 key : target . type === DraftType . Array ? Number ( key ) : key ,
140140 finalities : target . finalities ,
@@ -153,9 +153,6 @@ const proxyHandler: ProxyHandler<ProxyDraft> = {
153153 if ( arrayHandling && ! isDraft ( value ) && isDraftable ( value ) ) {
154154 target . options . skipFinalization ! . add ( value ) ;
155155 }
156- if ( ! arrayHandling && target . options . skipFinalization ! . has ( value ) ) {
157- target . options . skipFinalization ! . delete ( value ) ;
158- }
159156 return value ;
160157 } ,
161158 set ( target : ProxyDraft , key : string | number | symbol , value : any ) {
Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ export function handleValue(
2222 ! isDraftable ( target , options ) ||
2323 handledSet . has ( target ) ||
2424 Object . isFrozen ( target ) ||
25- options ? .skipFinalization ! . has ( target )
25+ ( options ! . skipFinalization ! . has ( target ) )
2626 )
2727 return ;
2828 const isSet = target instanceof Set ;
You can’t perform that action at this time.
0 commit comments