bundles/org.eclipse.orion.client.ui/web/gcli/gcli/types/resource.js
function dedupe(resources, onDupe) {
  // first create a map of name->[array of resources with same name]
  var names = {};
  resources.forEach(function(scriptResource) {
    if (names[scriptResource.name] == null) {
      names[scriptResource.name] = [];
    }
    names[scriptResource.name].push(scriptResource);
  });

  // Call the de-dupe function for each set of dupes
  Object.keys(names).forEach(function(name) {
    var clones = names[name];
    if (clones.length > 1) {
      onDupe(clones);
    }
  });
}
function dedupe(resources, onDupe) {
  // first create a map of name->[array of resources with same name]
  var names = {};
  resources.forEach(function(scriptResource) {
    if (names[scriptResource.name] == null) {
      names[scriptResource.name] = [];
    }
    names[scriptResource.name].push(scriptResource);
  });

  // Call the de-dupe function for each set of dupes
  Object.keys(names).forEach(function(name) {
    var clones = names[name];
    if (clones.length > 1) {
      onDupe(clones);
    }
  });
}
function dedupe ( resources , onDupe ) { // first create a map of name->[array of resources with same name] var names = { } ; resources . forEach ( function ( scriptResource ) { if ( names [ scriptResource . name ] == null ) { names [ scriptResource . name ] = [ ] ; } names [ scriptResource . name ] . push ( scriptResource ) ; } ) ; // Call the de-dupe function for each set of dupes Object . keys ( names ) . forEach ( function ( name ) { var clones = names [ name ] ; if ( clones . length > 1 ) { onDupe ( clones ) ; } } ) ; }
Find resources with the same name, and call onDupe to change the names
Find resources with the same name and call onDupe to change the names