遍历每一个节点
@param callback {Function}
@param data
@return {HostAdmin}
541059
function(callback, data){
        data = data || this._dataCache;
        var _this = this, i = 0, flag = true;
        for(i; i < data.length; i++){
            if(data[i].type == 'group'){
                flag = _this.each(callback, data[i].value);
            }else{
                flag = callback.call(data[i], data[i]);
            }
            if(flag == false){
                break;
            }
        }
        return flag;
    }
977918
function addCallback (t, data) {
  var result = data.result || data.error;
  cbid = data.id;
  if (t.callbacks[cbid]) {
    if (data.result) {
      t.callbacks[cbid](result);
    } else {
      t.callbacks[cbid](result, 'error');
    }
  }
}
394411
function(method, data, callback) {
      xhr.open(method, url, true, user, password);
      if (mimeType != null && !headers.has("accept")) headers.set("accept", mimeType + ",*/*");
      if (xhr.setRequestHeader) headers.each(function(value, name) { xhr.setRequestHeader(name, value); });
      if (mimeType != null && xhr.overrideMimeType) xhr.overrideMimeType(mimeType);
      if (responseType != null) xhr.responseType = responseType;
      if (timeout > 0) xhr.timeout = timeout;
      if (callback == null && typeof data === "function") callback = data, data = null;
      if (callback != null && callback.length === 1) callback = fixCallback(callback);
      if (callback != null) request.on("error", callback).on("load", function(xhr) { callback(null, xhr); });
      event.call("beforesend", request, xhr);
      xhr.send(data == null ? null : data);
      return request;
    }
367003
function(name,params,callback){

        if($bridge['callHandler']){

          $bridge.callHandler(name,params,function(data){
            if(typeof callback == 'function'){
              /* 解决部分系统加载延迟导致 ios/android 不响应问题 */
              setTimeout(function(){
                callback(data);
              },bridgeConfig.bridgeWebViewDelay)
            }
          })

        }else {
          console.log("don't built-in WebView invoking ",name,'{callHandler}')
        }
    }
44248
function handleDataAndCallCallback(data) {
			const j = file.lastIndexOf("/");

			// Pass on an updated rootpath if path of imported file is relative and file
			// is in a (sub|sup) directory
			//
			// Examples:
			// - If path of imported file is 'module/nav/nav.less' and rootpath is 'less/',
			//   then rootpath should become 'less/module/nav/'
			// - If path of imported file is '../mixins.less' and rootpath is 'less/',
			//   then rootpath should become 'less/../'
			if (newFileInfo.relativeUrls && !/^(?:[a-z-]+:|\/)/.test(file) && j != -1) {
				const relativeSubDirectory = file.slice(0, j+1);
				newFileInfo.rootpath = newFileInfo.rootpath + relativeSubDirectory; // append (sub|sup) directory path of imported file
			}
			// eslint-disable-next-line no-useless-escape
			newFileInfo.currentDirectory = pathname.replace(/[^\\\/]*$/, "");
			newFileInfo.filename = pathname;

			callback(null, data, pathname, newFileInfo);
		}
1025282
function (database, callback) {
        var s = this,
            querier = s._querier;
        querier.connect();
        async.waterfall([
            function (callback) {
                querier.showTables(database, function (err, tables) {
                    callback(err, tables);
                });
            },
            function (tables, callback) {
                var tableNames = s._parseTableNames(tables);
                async.map(tableNames, function (table, callback) {
                    querier.selectKeyColumnUsage(database, table, function (err, data) {
                        callback(err, {
                            name: table,
                            keyColumnUsage: s._parseTableKeyColumnUsageData(data)
                        });
                    });
                }, callback);
            },
            function (data, callback) {
                var database = {};
                data.forEach(function (data) {
                    database[data.name] = data.keyColumnUsage;
                });
                callback(null, database);
            }
        ], function (err, result) {
            querier.disconnect();
            callback(err, result);
        });
        return s;
    }
547647
function wrapCallback(resolver, promise, callback) {
        return function (data) {

            function work() {
                // 可能抛异常
                var res = callback(data);
                // 返回结果与当前的promise对象相同
                // 抛异常
                // see # 2.3.1
                if (res === promise) {
                    throw new TypeError();
                }

                resolve(resolver, res);
            }

            if (captureException) {
                try {
                    work();
                }
                catch (e) {
                    emitExceptionEvent(e);
                    resolver.reject(e);
                }
            }
            else {
                work();
            }

        };
    }
1263794
static public function fromArrayCallback(array $data, callable $callback) {
		$ret = new FormOptions();
		foreach ( $data as $item ){
			list($value, $text) = $callback($item);
			$ret->add($value, $text);
		}
		return $ret;
	}
860070
function(callback) {
      if (this.mysql) {
        var db = this;
        this.ready = false;
        this.mysql.end(function(error) {
          callback.call(db,error);
          if (error) {
            db.emit("error",error);
          } else {
            db.emit("close");
          }
        });
      } else {
        callback.call(this);
      }
      return this;
    }
495588
function (data, callback) {
            var html = '';
            var self = this;
            var fn = self.fn;
            callback = callback || function (error, ret) {
                html = ret;
            };
            var name = self.config.name;
            if (!name && fn.TPL_NAME) {
                name = fn.TPL_NAME;
            }
            var scope = new Scope(data), buffer = new LinkedBuffer(callback).head;
            renderTpl({
                name: name,
                fn: fn,
                session: {},
                root: self
            }, scope, buffer);
            return html;
        }
850619
function(type, data){
            var listeners = _cache[type],len = 0;
            if(!$.isUndefined(listeners)){
                var args = [].slice.call(arguments, 0);
                args = args.length > 2 ? args.splice(2, args.length-1) : [];
                args = [data].concat(args);

                len = listeners.length;
                for(var i = 0; i<len;i++){
                    var listener = listeners[i];
                    if(listener && listener.callback) {
                        args = args.concat(listener.args);
                        listener.callback.apply(listener.scope, args);
                    }
                }
            }
            return this;
        }
854329
public void send(String data, EventCallback callback) {
        send(data, null, null, callback);
    }
870037
function inetLatency(host, callback) {

  // fallback - if only callback is given
  if (util.isFunction(host) && !callback) {
    callback = host;
    host = '';
  }

  host = host || '8.8.8.8';

  return new Promise((resolve) => {
    process.nextTick(() => {
      let cmd;
      if (_linux || _freebsd || _openbsd || _darwin) {
        if (_linux) {
          cmd = 'ping -c 2 -w 3 ' + host + ' | grep rtt';
        }
        if (_freebsd || _openbsd) {
          cmd = 'ping -c 2 -t 3 ' + host + ' | grep round-trip';
        }
        if (_darwin) {
          cmd = 'ping -c 2 -t 3 ' + host + ' | grep avg';
        }

        exec(cmd, function (error, stdout) {
          let result = -1;
          if (!error) {
            const line = stdout.toString().split('=');
            if (line.length > 1) {
              const parts = line[1].split('/');
              if (parts.length > 1) {
                result = parseFloat(parts[1]);
              }
            }
          }
          if (callback) { callback(result); }
          resolve(result);
        });
      }
      if (_sunos) {
        exec('ping -s -a ' + host + ' 56 2 | grep avg', { timeout: 3000 }, function (error, stdout) {
          let result = -1;
          if (!error) {
            const line = stdout.toString().split('=');
            if (line.length > 1) {
              const parts = line[1].split('/');
              if (parts.length > 1) {
                result = parseFloat(parts[1].replace(',', '.'));
              }
            }
          }
          if (callback) { callback(result); }
          resolve(result);
        });
      }
      if (_windows) {
        let result = -1;
        try {
          exec('ping ' + host + ' -n 1', util.execOptsWin, function (error, stdout) {
            if (!error) {
              let lines = stdout.toString().split('\r\n');
              lines.shift();
              lines.forEach(function (line) {
                if ((line.toLowerCase().match(/ms/g) || []).length === 3) {
                  let l = line.replace(/ +/g, ' ').split(' ');
                  if (l.length > 6) {
                    result = parseFloat(l[l.length - 1]);
                  }
                }
              });
            }
            if (callback) { callback(result); }
            resolve(result);
          });
        } catch (e) {
          if (callback) { callback(result); }
          resolve(result);
        }
      }
    });
  });
}
1147734
function(callback) {
      var t = this,
          dirs = [],
          pages = [],
          thisAppName = UI.Server.currentServer.thisAppName;
      callback = callback || function(){};

      // Synchronize the virtual /app directory
      if (t.get('path') === '/app') {
        for (var appName in UI.Server.currentServer.apps) {
          // Don't add me to the /app directory if I'm an app
          if (appName !== thisAppName) {
            var app = UI.Server.currentServer.apps[appName];
            dirs.push({
              id: appName,
              label: app.label || app.description || appName,
              path: Path.join(app.moduleDir, 'site_db', t.CONST.objectClass)
            });
          }
        }

        // Trim directory branches that have no contents
        t.trimDirs(dirs, function(error, trimmed) {
          if (error) {
            callback(error);
          }
          t.set({
            leaves: pages,
            branches: trimmed
          });
          return callback();
        });
        return;
      }

      // Get the directory at this level
      FS.readdir(t.dirPath, function(error, fileNames) {

        // Process errors
        if (error) {
          console.error('TreeProbe readdir error', error);
          return callback(error);
        }

        // Don't show the main 404 page (it's too confusing)
        if (t.CONST.objectClass === 'Page') {
          fileNames = _.reject(fileNames, function(name){
            return name === '404.json';
          });
        }

        // Perform a stat on all files for meta-info
        t.statFiles(fileNames, function(error, fileStats) {

          // Process errors
          if (error) {
            console.error('TreeProbe statFiles error', error);
            return callback(error);
          }

          // Process each file, recording directories and pages
          for (var i = 0, l = fileStats.length; i < l; i++) {
            var name = fileNames[i],
                stat = fileStats[i],
                id = Path.basename(name, '.json'),
                page = {id:id};

            if (stat.isDirectory()) {
              page.path = Path.join(t.dirPath, name);
              dirs.push(page);
            }
            else if (stat.isFile() && Path.extname(name).toLowerCase() === '.json') {
              pages.push(page);
            }
            else {
              console.error('Not a file or directory: ' + name);
            }
          }

          // Read each page for the display label and description
          t.readPages(pages, function(error) {

            // Process errors
            if (error) {
              console.error('PagesProbe readPages error', error);
              return callback(error);
            }

            // Add the virtual /app directory to the root
            if (t.dirPath === t.rootPath) {
              dirs.push({
                id:'app',
                label: t.CONST.appLabel,
                description: t.CONST.appDescription,
                path: Path.dirname(t.dirPath)
              });
            }

            // Trim directory branches that have no contents
            t.trimDirs(dirs, function(error, trimmed) {
              if (error) {
                callback(error);
              }

              t.set({
                leaves: pages,
                branches: trimmed
              });
              return callback();
            });
          });

        });
      });

    }
223163
function(params, callback) {
      var t = this;
      if (params === '.break' && t.shellCmd) {
        t.shellCmd.kill();
      }
      if (NEW_REPL) {
        t.stream.emit('data', params + "\n");
      } else {
        t.stream.emit('data', params);
      }
      return callback(null);
    }
335531
function (callback) {
	return function (res) {
		var resData = "";
		res.setEncoding('utf8');
		res.on('data',function(chunk) { resData+=chunk; });
		res.on('end', function() { callback(res,resData); });
	};
}
903459
function (data) {
    var user = this$1.onSuccess(data);
    if (isFunction(onSuccess)) {
      onSuccess(user);
    }
    return user
  }