lib/utils/fs/parse.js/parse
function parse(filePath, contents) {
  // Auto-parse JSON
  if (filePath.endsWith('.json')) {
    return jc.parse(contents);
  } else if (filePath.endsWith('.yml') || filePath.endsWith('.yaml')) {
    const options = {
      filename: filePath,
    };
    let result = loadYaml(contents.toString(), options);
    if (result.error && result.error.name === 'YAMLException') {
      _.merge(options, { schema: cloudFormationSchema.schema });
      result = loadYaml(contents.toString(), options);
    }
    if (result.error) {
      throw result.error;
    }
    return result.data;
  }
  return contents.toString().trim();
}