@@ -46,15 +46,12 @@ function ObjectIron(mappers) {
4646 return allowMapping ;
4747 }
4848
49- function _conditionallyMapProperty ( exception , propertyParentElement , parentIsArray , parentEl , child , mergeFlag ) {
49+ function _conditionallyMapProperty ( exception , propertyParentElement , parentIsArray , parentEl , child ) {
5050 if ( _mappingAllowed ( parentEl , exception ) ) {
5151 if ( child [ propertyParentElement ] ) {
5252 // property already exists
53- // check to see if we should merge
54- if ( mergeFlag ) {
55- if ( parentIsArray ) {
56- child [ propertyParentElement ] . push ( parentEl ) ;
57- }
53+ if ( parentIsArray ) {
54+ child [ propertyParentElement ] . push ( parentEl ) ;
5855 }
5956 } else {
6057 // just add the property
@@ -71,15 +68,15 @@ function ObjectIron(mappers) {
7168 for ( let i = 0 , len = properties . length ; i < len ; ++ i ) {
7269 const property = properties [ i ] ;
7370
74- if ( parent [ property . name ] ) {
75- const propertyParentElement = parent [ property . name ] ;
71+ if ( parent [ property ] ) {
72+ const propertyParentElement = parent [ property ] ;
7673
7774 if ( Array . isArray ( propertyParentElement ) ) {
7875 propertyParentElement . forEach ( propParentEl => {
79- _conditionallyMapProperty ( exceptions [ property . name ] , property . name , true , propParentEl , child , property . merge ) ;
76+ _conditionallyMapProperty ( exceptions [ property ] , property , true , propParentEl , child ) ;
8077 } ) ;
8178 } else {
82- _conditionallyMapProperty ( exceptions [ property . name ] , property . name , false , propertyParentElement , child , property . merge ) ;
79+ _conditionallyMapProperty ( exceptions [ property ] , property , false , propertyParentElement , child ) ;
8380 }
8481 }
8582 }
0 commit comments