MCPcopy Index your code
hub / github.com/stemkoski/stemkoski.github.com / defaults

Function defaults

MathBox/mathbox-bundle.js:36992–37012  ·  view source on GitHub ↗
(object, source, guard)

Source from the content-addressed store, hash-verified

36990 * // => { 'name': 'barney', 'employer': 'slate' }
36991 */
36992 var defaults = function(object, source, guard) {
36993 var index, iterable = object, result = iterable;
36994 if (!iterable) return result;
36995 var args = arguments,
36996 argsIndex = 0,
36997 argsLength = typeof guard == 'number' ? 2 : args.length;
36998 while (++argsIndex < argsLength) {
36999 iterable = args[argsIndex];
37000 if (iterable && objectTypes[typeof iterable]) {
37001 var ownIndex = -1,
37002 ownProps = objectTypes[typeof iterable] && keys(iterable),
37003 length = ownProps ? ownProps.length : 0;
37004
37005 while (++ownIndex < length) {
37006 index = ownProps[ownIndex];
37007 if (typeof result[index] == 'undefined') result[index] = iterable[index];
37008 }
37009 }
37010 }
37011 return result
37012 };
37013
37014 /**
37015 * This method is like `_.findIndex` except that it returns the key of the

Callers 1

templateFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected