File tree Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Expand file tree Collapse file tree 1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -91,18 +91,14 @@ function serializeNode(node) {
91
91
: Object . keys ( internal . props )
92
92
const ctx = clone ( internal . ctx )
93
93
serialized . detail = {
94
- attributes : props . reduce ( ( o , key ) => {
95
- const value = ctx [ key ]
96
- if ( value === undefined ) return o
97
-
94
+ attributes : props . flatMap ( key => {
98
95
delete ctx [ key ]
99
- o . push ( { key, value, isBound : key in internal . bound } )
100
- return o
101
- } , [ ] ) ,
102
- listeners : Object . entries ( internal . callbacks ) . reduce (
103
- ( list , [ event , value ] ) =>
104
- list . concat ( value . map ( o => ( { event, handler : o . toString ( ) } ) ) ) ,
105
- [ ]
96
+ return ctx [ key ] === undefined
97
+ ? [ ]
98
+ : { key, value : ctx [ key ] , isBound : key in internal . bound }
99
+ } ) ,
100
+ listeners : Object . entries ( internal . callbacks ) . flatMap (
101
+ ( [ event , value ] ) => value . map ( o => ( { event, handler : o . toString ( ) } ) )
106
102
) ,
107
103
ctx : Object . entries ( ctx ) . map ( ( [ key , value ] ) => ( { key, value } ) )
108
104
}
You can’t perform that action at this time.
0 commit comments