'use strict';

class SocialAccounts {

    constructor(obj) {
        this.config = obj && obj.config;
        this.validator = obj && obj.validator;
        this.helperName = obj && obj.helperName;
    }

    getData(accounts) {
        var arr = [];

        accounts.forEach((account) => {
            arr.push({
                account: account,
                url: this.config.get(`${account}PageUrl`),
                icon: `icon-${account}`
            });
        });

        return {
            items: arr
        }
    }

    get(accounts) {
        this.validator.validate(accounts);
        return this.getData(accounts);
    }

}

module.exports = SocialAccounts;
@@ -206,16 +206,20 @@
 %0A    get
+Item
 Data(acc
@@ -214,33 +214,32 @@
 ItemData(account
-s
 ) %7B%0A        var 
@@ -238,110 +238,28 @@
     
-var arr = %5B%5D;%0A%0A        accounts.forEach((account) =%3E %7B%0A            arr.push(%7B%0A                account:
+return %7B%0A           
  acc
@@ -264,20 +264,16 @@
 ccount,%0A
-    
         
@@ -319,20 +319,16 @@
 eUrl%60),%0A
-    
         
@@ -367,76 +367,221 @@
     
+%7D%0A
     %7D
-);%0A        %7D);%0A%0A        return %7B%0A            items: arr%0A       
+%0A%0A    getData(accounts) %7B%0A        var items = %5B%5D;%0A%0A        accounts.forEach((account) =%3E %7B%0A            var item = this.getItemData(account);%0A            items.push(item);%0A        %7D);%0A%0A        return %7B items
  %7D%0A 

Refactor social accounts module (use more of ES6)