深度克隆对象
@param {Object} target 目标对象
@param {Object} src 原始对象
@returns {Object}
186443
function deepClone(target, src) {
  target = target || {};
  Object.keys(src).forEach(key => {
    if (typeof target[key] !== 'object' || Array.isArray(target[key])) {
      target[key] = src[key];
    } else {
      target[key] = _lodash2.default.defaultsDeep({}, src[key], target[key]);
    }
  });
  return target;
}
943379
function unzip(src, target, fn) {
    fs
        .createReadStream(src)
        .pipe(Unzip.Extract({path: target}))
        .on('close', fn || function(){})
}
993034
function createSeekPathSrc(target) {
  return (
    '"use strict";\n' + //go fast sauce!
    target.map(function (e, i) {
      return '  var k'+i+' = Buffer.from('+ JSON.stringify(e) +');' //strings only!
    }).join('\n') + '\n'+
    "  return function (buffer, start) {\n"+
    target.map(function (_, i) {
      return "  start = seekKey(buffer, start, k"+i+")"
    }).join('\n') + '\n' +
    '  return start;\n'+
    '}\n'
  )
}
266003
public BeanMappingObject getBeanMappingObject(Class src, Class target) {
        return getFromRepository(src, target, this.repository);
    }
1044379
function(target, level, format) {  //+ arguments
    // try to get debugLevel from calling object or global config
    if (target && target.dbgLevel)  dbgLevel = target.dbgLevel;
    else dbgLevel = config.DBG_LVL || 1;
    
    if (dbgLevel >= level ) {

        var args = [].slice.call(arguments, 2); // copy argument in a real array leaving out level
        var message = util.format.apply(null, args);
        
        var trace = new TracePoint().trace;
        var info = {
            fullpath : trace[1].getFileName(),
            linenum  : trace[1].getLineNumber(),
            basename : path.basename (trace[1].getFileName())
        };
        
        if (dbgLevel >= 5) {
            console.log("%s:%d", info.fullpath, info.linenum);
            console.log("\t[%d] %j", dbgLevel, message);
        }
        else console.log("--%d-- [%s:%d] -- %j", dbgLevel, info.basename, info.linenum, message);
    }
}
1173354
async function copy(src, dist) {
    let stats = await stat(src),
        files;

    // 处理文件
    if (!stats.isDirectory()) {
        return await copyFile(src, dist);
    }

    // 生成目标路径
    if (!await stat(dist)) {
        await local.mkdir(dist);
    }

    // 读取文件夹
    files = await local.readdir(src);

    // 处理文件
    await Promise.all(files.map(file => (
        file === 'node_modules' ? Promise.resolve() : copy(path.resolve(src, file), path.resolve(dist, file))
    )));
}
69591
function (target, source) {
            if (this.children) {
                if(target.parentNode){
                    target.parentNode.removeChild(target);
                }
                for (var i = 0, ci; ci = this.children[i]; i++) {
                    if (ci === source) {
                        this.children.splice(i + 1, 0, target);
                        target.parentNode = this;
                        return target;
                    }

                }
            }
        }
162607
function( target, object ) {
    if ((
      typeof target === 'object' ||
      typeof target === 'function' ) &&
      typeof object === 'object'
    ) {
      for ( var name in object ) {
        if (object.hasOwnProperty( name )) {
          target[ name ] = object[ name ]
        }
      }
    }
    return target
  }
1302123
function recursiveMerge (target, src) {
    for (var prop in src) {
        if (src.hasOwnProperty(prop)) {
            if (target.prototype && target.prototype.constructor === target) {
                // If the target object is a constructor override off prototype.
                clobber(target.prototype, prop, src[prop]);
            } else {
                if (typeof src[prop] === 'object' && typeof target[prop] === 'object') {
                    recursiveMerge(target[prop], src[prop]);
                } else {
                    clobber(target, prop, src[prop]);
                }
            }
        }
    }
}
166613
function(target,source) {
    var keys = Object.keys(source);
    var len = keys.length;
    for (var i = 0; i < len; i++) {
      var key = keys[i];
      if (lib.type.isObject(source[key])) {
        if (!lib.type.isObject(target[key])) {
          target[key] = {};
        }
        factory.merge(target[key],source[key]);
      } else {
        target[key] = source[key];
      }
    }
    return target;
  }
878592
function(target) {
	target.adapter = exports;
	target.query = execQuery.bind(target);

	// Tedious cannot execute more than one query at a time, so we have to
	// implement a queue for queries, just in case someone tries to set
	// multiple queries in a row (like node-any-db-adapter-spec tests do).
	target._queue = [];
	target._waitingForQueryToFinish = false;
	var _execNextInQueue = function(){
		if (target._waitingForQueryToFinish) {
			return;
		}

		var query = target._queue.shift();

		if (query) {
			target._waitingForQueryToFinish = true;
			target.emit('query', query);

			query.once('close', function(){
				target._waitingForQueryToFinish = false;
				target.execNextInQueue();
			});

			target.execSql(query._request);
		}
	};
	target.execNextInQueue = function(query){
		if (query) {
			target._queue.push(query);
		}

		if (target._isConnected) {
			process.nextTick(_execNextInQueue);
		}
	};

	return target;
}
470511
function extend( target, src ) {
		var name, copy, copyIsArray, clone,
			options = src,
			i = 1,
			deep = true;
		// Handle a deep copy situation
		if( typeof target === 'boolean' ) {
			deep = target;
			// skip the boolean and the target
			i = 2;
		}
		// Handle case when target is a string or something( possible in deep copy )
		if( typeof target !== 'object' && typeof target !== 'function' ){
			target = {};
		}
		// Only deal with non-null/undefined values
		if (! options) return target;

			// Extend the base object
		for( name in options ) {
			src = target[name];
			copy = options[name];
			// Prevent never-ending loop
			if( target === copy ) continue;
			// Recurse if we're merging plain objects or arrays
			copyIsArray = Array.isArray(copy);
			if( deep && (typeof copy === 'object' || copyIsArray)) {
				if( copyIsArray ) {
					clone = src && Array.isArray(src) ? src : [];
				} else clone = src && typeof src === 'object' ? src : {};
				// Never move original objects, clone them
				target[name] = extend(clone, copy);
				// Don't bring in undefined values
			} else if( typeof copy !== 'undefined' ) target[name] = copy;
		}

		return target;
	}
558856
function clone(target) {
  if (target == null || typeof target !== "object") return target;
  var cloned = target.constructor ? target.constructor() : Object.create(null);
  for (var attr in target) {
    if (target.hasOwnProperty(attr)) {
      cloned[attr] = target[attr];
    }
  }
  return cloned;
}
1265942
private static String getRelativePath(File src, File target) {
        String[] srcComponents = getCanonicalPath(src).replace(File.separatorChar, '/').split("/");
        String[] targetComponents = getCanonicalPath(target).replace(File.separatorChar, '/').split("/");

        if (srcComponents.length > 0 && targetComponents.length > 0 && !targetComponents[0].equals(srcComponents[0])) {
            return null;
        }

        int common = 0;
        for (int minLength = Math.min(srcComponents.length, targetComponents.length); common < minLength; common++) {
            if (!srcComponents[common].equals(targetComponents[common])) {
                break;
            }
        }

        StringBuilder result = new StringBuilder();

        // Paths in a file are relative to the file's directory, so subtract one
        // to skip the final filename component.
        for (int i = common; i < srcComponents.length - 1; i++) {
            if (result.length() != 0) {
                result.append('/');
            }
            result.append("..");
        }

        for (int i = common; i < targetComponents.length; i++) {
            if (result.length() != 0) {
                result.append('/');
            }
            result.append(targetComponents[i]);
        }

        return result.toString();
    }
873578
function makeRelPath(sourceUrl, targetUrl) {
  var source = sourceUrl.pathname;
  var target = targetUrl.pathname;
  var s = source.split('/');
  var t = target.split('/');
  while (s.length && s[0] === t[0]){
    s.shift();
    t.shift();
  }
  for (var i = 0, l = s.length - 1; i < l; i++) {
    t.unshift('..');
  }
  // empty '#' is discarded but we need to preserve it.
  var hash = (targetUrl.href.slice(-1) === URL_HASH) ? URL_HASH : targetUrl.hash;
  return t.join('/') + targetUrl.search + hash;
}
1348796
function readTargetRc () {
  if (!fs.existsSync('./.dabao.target.json')) {
    return {}
  }
  try {
    const content = fs.readFileSync('./.dabao.target.json', { encoding: 'utf-8' })
    return JSON.parse(content)
  } catch (e) {
    console.warn('[Warning] File parsing error: .dabao.target.json')
    console.warn(e)
    return {}
  }
}
59337
function dirMaker(target) {
    // check if parent directory exists
    var parentDir = path_1.dirname(target);
    if (!fs_1.existsSync(parentDir)) {
        dirMaker(parentDir);
    }
    // check if directory exists
    if (!fs_1.existsSync(target)) {
        fs_1.mkdirSync(target);
    }
}