1 /**
  2  * Hilo
  3  * Copyright 2015 alibaba.com
  4  * Licensed under the MIT License
  5  */
  6 
  7 /**
  8  * @class 工具方法集合
  9  * @static
 10  * @module hilo/util/util
 11  */
 12 var util = {
 13     /**
 14      * 简单的浅复制对象。
 15      * @param {Object} target 要复制的目标对象。
 16      * @param {Object} source 要复制的源对象。
 17      * @param {Boolean} strict 指示是否复制未定义的属性,默认为false,即不复制未定义的属性。
 18      * @returns {Object} 复制后的对象。
 19      */
 20     copy: function(target, source, strict){
 21         for(var key in source){
 22             if(!strict || target.hasOwnProperty(key) || target[key] !== undefined){
 23                 target[key] = source[key];
 24             }
 25         }
 26         return target;
 27     }
 28 };