lib/cfn.js
function compileFunction() {
  let template = {};

  if (arguments) {
    for (let arg of arguments) {
      mergeArgumentsTemplate(template, arg, 'Metadata');
      mergeArgumentsTemplate(template, arg, 'Parameters');
      mergeArgumentsTemplate(template, arg, 'Mappings');
      mergeArgumentsTemplate(template, arg, 'Conditions');
      mergeArgumentsTemplate(template, arg, 'Resources');
      mergeArgumentsTemplate(template, arg, 'Outputs');
      mergeArgumentsTemplate(template, arg, 'Variables');
      let areValidPolicies = arg.Policies && Array.isArray(arg.Policies) && arg.Policies.length > 0;
      if (areValidPolicies) {
        if (!template.Policies) {
          template.Policies = [];
        }
        template.Policies = template.Policies.concat(arg.Policies);
      }
    }
  }

  return template;
}
function compileFunction() {
  let template = {};

  if (arguments) {
    for (let arg of arguments) {
      mergeArgumentsTemplate(template, arg, 'Metadata');
      mergeArgumentsTemplate(template, arg, 'Parameters');
      mergeArgumentsTemplate(template, arg, 'Mappings');
      mergeArgumentsTemplate(template, arg, 'Conditions');
      mergeArgumentsTemplate(template, arg, 'Resources');
      mergeArgumentsTemplate(template, arg, 'Outputs');
      mergeArgumentsTemplate(template, arg, 'Variables');
      let areValidPolicies = arg.Policies && Array.isArray(arg.Policies) && arg.Policies.length > 0;
      if (areValidPolicies) {
        if (!template.Policies) {
          template.Policies = [];
        }
        template.Policies = template.Policies.concat(arg.Policies);
      }
    }
  }

  return template;
}
function compileFunction ( ) { let template = { } ; if ( arguments ) { for ( let arg of arguments ) { mergeArgumentsTemplate ( template , arg , 'Metadata' ) ; mergeArgumentsTemplate ( template , arg , 'Parameters' ) ; mergeArgumentsTemplate ( template , arg , 'Mappings' ) ; mergeArgumentsTemplate ( template , arg , 'Conditions' ) ; mergeArgumentsTemplate ( template , arg , 'Resources' ) ; mergeArgumentsTemplate ( template , arg , 'Outputs' ) ; mergeArgumentsTemplate ( template , arg , 'Variables' ) ; let areValidPolicies = arg . Policies && Array . isArray ( arg . Policies ) && arg . Policies . length > 0 ; if ( areValidPolicies ) { if ( ! template . Policies ) { template . Policies = [ ] ; } template . Policies = template . Policies . concat ( arg . Policies ) ; } } } return template ; }
Takes a list of object and merges them into a template stub
Takes a list of object and merges them into a template stub