I'm basically trying to build a function that searches all nodes on the DOM to check for data attributes, then swap them out with whatever is stored with the "data-intl-" attribute. For example, if someone had data-intl-attr, whatever attr is on, that node would get replaced by what's in data-intl-attr. 
The code works; I just want to know if I could have approached it differently.
var all = $('*');
$.map(all,function(el) {
    filter($(el).data(), function(clean){
      var originalAttrVal = $(el).attr(clean);
      var intlAttr = $(el).attr("data-intl-" + clean);
      $(el).attr(clean, intlAttr);
    });
});
function filter(foo, cb){
        var capture;
    for(var i in foo) {
      if (foo.hasOwnProperty(i)) {
        i = i.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
        i = i.replace(/intl-/g, '');
        capture= i;
     }      
     cb(capture);
  }
}
Input HTML:
<a href="a-link.html" data-intl-href="newval.html">test href</a>
<img src="https://test.com/logo.png" data-intl-src="newval.png">
Output HTML:
<a href="newval.html" data-intl-href="newval.html">test href</a>
<img src="newval.png" data-intl-src="newval.png">
