lib/cfn.js
function mergeArgumentsTemplate(template, arg, propertyName) {
  if (!template.hasOwnProperty(propertyName)) {
    template[propertyName] = {};
  }

  if (arg.hasOwnProperty(propertyName)) {

    if (!arg[propertyName]) {
      arg[propertyName] = {};
    }

    Object.keys(arg[propertyName]).forEach((key) => {
      if (template[propertyName].hasOwnProperty(key)) {
        throw new Error(propertyName + ' name used more than once: ' + key);
      }

      template[propertyName][key] = JSON.parse(JSON.stringify(arg[propertyName][key]));
    });
  }
}
function mergeArgumentsTemplate(template, arg, propertyName) {
  if (!template.hasOwnProperty(propertyName)) {
    template[propertyName] = {};
  }

  if (arg.hasOwnProperty(propertyName)) {

    if (!arg[propertyName]) {
      arg[propertyName] = {};
    }

    Object.keys(arg[propertyName]).forEach((key) => {
      if (template[propertyName].hasOwnProperty(key)) {
        throw new Error(propertyName + ' name used more than once: ' + key);
      }

      template[propertyName][key] = JSON.parse(JSON.stringify(arg[propertyName][key]));
    });
  }
}
function mergeArgumentsTemplate ( template , arg , propertyName ) { if ( ! template . hasOwnProperty ( propertyName ) ) { template [ propertyName ] = { } ; } if ( arg . hasOwnProperty ( propertyName ) ) { if ( ! arg [ propertyName ] ) { arg [ propertyName ] = { } ; } Object . keys ( arg [ propertyName ] ) . forEach ( ( key ) => { if ( template [ propertyName ] . hasOwnProperty ( key ) ) { throw new Error ( propertyName + ' name used more than once: ' + key ) ; } template [ propertyName ] [ key ] = JSON . parse ( JSON . stringify ( arg [ propertyName ] [ key ] ) ) ; } ) ; } }
Merge arguments with template arguments
@param template
@param arg
@param propertyName
Merge arguments with template arguments