lib/grunt.js
function merge(target, source) {
  // Check if font name is changed
  if (source['font-name']) {
    target['font-name'] = source['font-name'];
  }

  // Check if root dir is changed
  if (source['root-dir']) {
    target['root-dir'] = source['root-dir'];
  }

  // Check for icon changes
  if (source.icons) {
    for (let icon of source['icons']) {
      let index = iconsIndex.indexOf(icon.name);

      // Icon is replaced
      if (index !== -1) {
        target.icons[index] = icon;
      }
      // New icon is added
      else {
        target.icons.push(icon);
        iconsIndex.push(icon.name);
      }
    }
  }

  return target;
}
function merge(target, source) {
  // Check if font name is changed
  if (source['font-name']) {
    target['font-name'] = source['font-name'];
  }

  // Check if root dir is changed
  if (source['root-dir']) {
    target['root-dir'] = source['root-dir'];
  }

  // Check for icon changes
  if (source.icons) {
    for (let icon of source['icons']) {
      let index = iconsIndex.indexOf(icon.name);

      // Icon is replaced
      if (index !== -1) {
        target.icons[index] = icon;
      }
      // New icon is added
      else {
        target.icons.push(icon);
        iconsIndex.push(icon.name);
      }
    }
  }

  return target;
}
function merge ( target , source ) { // Check if font name is changed if ( source [ 'font-name' ] ) { target [ 'font-name' ] = source [ 'font-name' ] ; } // Check if root dir is changed if ( source [ 'root-dir' ] ) { target [ 'root-dir' ] = source [ 'root-dir' ] ; } // Check for icon changes if ( source . icons ) { for ( let icon of source [ 'icons' ] ) { let index = iconsIndex . indexOf ( icon . name ) ; // Icon is replaced if ( index !== - 1 ) { target . icons [ index ] = icon ; } // New icon is added else { target . icons . push ( icon ) ; iconsIndex . push ( icon . name ) ; } } } return target ; }
Merge a `source` object to a `target` recursively
Merge a source object to a target recursively