forked from public/fvtt-cthulhu-eternal
		
	Initial import with skill sheet working
This commit is contained in:
		
							
								
								
									
										35
									
								
								node_modules/object.defaults/mutable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								node_modules/object.defaults/mutable.js
									
									
									
										generated
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| 'use strict'; | ||||
|  | ||||
| var each = require('array-each'); | ||||
| var slice = require('array-slice'); | ||||
| var forOwn = require('for-own'); | ||||
| var isObject = require('isobject'); | ||||
|  | ||||
| /** | ||||
|  * Extends the `target` object with properties of one or | ||||
|  * more additional `objects` | ||||
|  * | ||||
|  * @name .defaults | ||||
|  * @param  {Object} `target` The target object. Pass an empty object to shallow clone. | ||||
|  * @param  {Object} `objects` | ||||
|  * @return {Object} | ||||
|  * @api public | ||||
|  */ | ||||
|  | ||||
| module.exports = function defaults(target, objects) { | ||||
|   if (target == null) { | ||||
|     return {}; | ||||
|   } | ||||
|  | ||||
|   each(slice(arguments, 1), function(obj) { | ||||
|     if (isObject(obj)) { | ||||
|       forOwn(obj, function(val, key) { | ||||
|         if (target[key] == null) { | ||||
|           target[key] = val; | ||||
|         } | ||||
|       }); | ||||
|     } | ||||
|   }); | ||||
|  | ||||
|   return target; | ||||
| }; | ||||
		Reference in New Issue
	
	Block a user