lib/vissense.js
function extend(dest, source, callback) {
  var index = -1,
    props = Object.keys(source),
    length = props.length,
    ask = isFunction(callback);

  while (++index < length) {
    var key = props[index];
    dest[key] = ask ?
      callback(dest[key], source[key], key, dest, source) : source[key];
  }

  return dest;
}
function extend(dest, source, callback) {
  var index = -1,
    props = Object.keys(source),
    length = props.length,
    ask = isFunction(callback);

  while (++index < length) {
    var key = props[index];
    dest[key] = ask ?
      callback(dest[key], source[key], key, dest, source) : source[key];
  }

  return dest;
}
function extend ( dest , source , callback ) { var index = - 1 , props = Object . keys ( source ) , length = props . length , ask = isFunction ( callback ) ; while ( ++ index < length ) { var key = props [ index ] ; dest [ key ] = ask ? callback ( dest [ key ] , source [ key ] , key , dest , source ) : source [ key ] ; } return dest ; }
This callback lets you intercept the assignment of
individual properties. The return value will be assigned
to the `destKey` property of the `dest` object.
If this callback is not provided `sourceValue` will be assigned.

@callback extendCallback
@memberof VisSense.Utils

@param {*} destValue The destination value that will be replaced.
@param {*} sourceValue The source value than will replace the destination
value.
@param {*} destKey The destination key.
@param {*} sourceKey The source key.
@param {*} dest The given destination.
@param {*} source The given source.
 
@function
@name extend
@memberof VisSense.Utils

@param {Object} dest The destination object.
@param {Object} source The source object.
@param {VisSense.Utils.extendCallback} [callback] The function to customize assigning
values.

@returns {Object}

@description Overwrites all properties of the destination object with the
source object's properties. You can provide an optional callback function
to modify the behaviour and/or to manipulate the return value.

@example

VisSense.Utils.extend({
name: 'Max',
age: 31
}, {
name: 'Bradley',
gender: 'male'
});
// => { name: 'Bradley', age: 31, gender: 'male' }


VisSense.Utils.extend({
name: 'Max',
age: 31
}, {
name: 'Bradley',
gender: 'male'
}, function(destValue, srcValue, key) {
if(key === 'age') return destValue + 42;
return srcValue;
});
// => { name: 'Bradley', age: 73, gender: 'male' }
This callback lets you intercept the assignment of individual properties . The return value will be assigned to the destKey property of the dest object . If this callback is not provided sourceValue will be assigned .