File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -20,25 +20,20 @@ export function createAction (action, store) {
20
20
* Merge an array of objects into one.
21
21
*
22
22
* @param {Array<Object> } arr
23
- * @param {Boolean } allowDuplicate
24
23
* @return {Object }
25
24
*/
26
25
27
- export function mergeObjects ( arr , allowDuplicate ) {
26
+ export function mergeObjects ( arr ) {
28
27
return arr . reduce ( ( prev , obj ) => {
29
28
Object . keys ( obj ) . forEach ( key => {
30
29
const existing = prev [ key ]
31
30
if ( existing ) {
32
31
// allow multiple mutation objects to contain duplicate
33
32
// handlers for the same mutation type
34
- if ( allowDuplicate ) {
35
- if ( Array . isArray ( existing ) ) {
36
- existing . push ( obj [ key ] )
37
- } else {
38
- prev [ key ] = [ prev [ key ] , obj [ key ] ]
39
- }
33
+ if ( Array . isArray ( existing ) ) {
34
+ existing . push ( obj [ key ] )
40
35
} else {
41
- console . warn ( `[vuex] Duplicate action: ${ key } ` )
36
+ prev [ key ] = [ prev [ key ] , obj [ key ] ]
42
37
}
43
38
} else {
44
39
prev [ key ] = obj [ key ]
You can’t perform that action at this time.
0 commit comments