code: function mapJSON(iterator) {
    return map.obj(function(file) {
      if (file.isStream()) {
        this.emit('error', new Error('gulp-bower-overrides: Streaming not supported at this time.'));
      }
  
      try {
        var json = JSON.parse(file.contents.toString());
        json = iterator.call(this, json, file);
        file.contents = new Buffer(JSON.stringify(json, null, 2));
        return file;
      } catch (err) {
        this.emit('error', err);
      }
    });
  }
docs: wrapper around map.obj that calls iterator function for each file with parsed JSON contents. iterator receives (file, json) arguments and returns new json content.