File tree 1 file changed +15
-6
lines changed
Filter options
1 file changed +15
-6
lines changed
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import isDataStructure from '../utils/isDataStructure';
11
11
import quoteString from '../utils/quoteString' ;
12
12
import { NOT_SET } from '../TrieUtils' ;
13
13
import { emptyMap } from '../Map' ;
14
+ import { emptyList } from '../List' ;
14
15
import { get } from './get' ;
15
16
import { remove } from './remove' ;
16
17
import { set } from './set' ;
@@ -66,10 +67,18 @@ function updateInDeeply(
66
67
return nextUpdated === nextExisting
67
68
? existing
68
69
: nextUpdated === NOT_SET
69
- ? remove ( existing , key )
70
- : set (
71
- wasNotSet ? ( inImmutable ? emptyMap ( ) : { } ) : existing ,
72
- key ,
73
- nextUpdated
74
- ) ;
70
+ ? remove ( existing , key )
71
+ : set (
72
+ wasNotSet
73
+ ? inImmutable
74
+ ? typeof key === 'number'
75
+ ? emptyList ( )
76
+ : emptyMap ( )
77
+ : typeof key === 'number'
78
+ ? [ ]
79
+ : { }
80
+ : existing ,
81
+ key ,
82
+ nextUpdated
83
+ ) ;
75
84
}
You can’t perform that action at this time.
0 commit comments