File tree Expand file tree Collapse file tree 2 files changed +8
-9
lines changed
Expand file tree Collapse file tree 2 files changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -53,14 +53,14 @@ export default {
5353 input . forEach ( section => {
5454 // Copy the relevant properties from each section into our output
5555 propertiesToCopy . forEach ( property => {
56- if ( Array . isArray ( section [ property ] ) ) {
57- let toPush = section [ property ] ;
56+ const items = section [ property ] ;
5857
59- if ( section . source ) {
60- toPush = toPush . map ( item => ( { ...item , source : section . source } ) ) ;
61- }
58+ if ( Array . isArray ( items ) ) {
59+ const enrichedItems = section . source
60+ ? items . map ( item => ( { ...item , source : section . source } ) )
61+ : items ;
6262
63- generatedValue [ property ] . push ( ...toPush ) ;
63+ generatedValue [ property ] . push ( ...enrichedItems ) ;
6464 }
6565 } ) ;
6666 } ) ;
Original file line number Diff line number Diff line change @@ -64,9 +64,8 @@ export const createSectionBuilder = () => {
6464 }
6565
6666 // Check if there are any non-empty fields in the meta object
67- const atLeastOneNonEmptyField = Object . values ( meta ) . some (
68- value => value . length > 0
69- ) ;
67+ const atLeastOneNonEmptyField =
68+ changes ?. length || Object . keys ( meta ) . length > 1 ;
7069
7170 // Return undefined if the meta object is completely empty
7271 return atLeastOneNonEmptyField ? meta : undefined ;
You can’t perform that action at this time.
0 commit comments