本文整理汇总了TypeScript中dojo/_base/array.map函数的典型用法代码示例。如果您正苦于以下问题:TypeScript map函数的具体用法?TypeScript map怎么用?TypeScript map使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了map函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: function
getChildren: function (treeNode, options) {
var data = [];
if (treeNode.__hpcc_children.length) {
data = treeNode.__hpcc_children;
} else {
switch (this._viewMode) {
case "Targets":
data = arrayUtil.map(treeNode.__hpcc_treeItem.__hpcc_children, function (item) {
return this.createTreeNode(treeNode, item);
}, this);
break;
case "Services":
if (!treeNode.__hpcc_parentNode) {
arrayUtil.forEach(treeNode.__hpcc_treeItem.__hpcc_children, function (child) {
var serviceNode = this.createTreeNode(treeNode, child);
var machines = [];
var bindings = [];
arrayUtil.forEach(child.__hpcc_children, function (gchild) {
if (gchild instanceof TpMachine) {
machines.push(gchild);
} else if (gchild instanceof TpBinding) {
bindings.push(gchild);
}
}, this);
arrayUtil.forEach(bindings, function (binding) {
var bindingNode = this.createTreeNode(serviceNode, binding);
arrayUtil.forEach(machines, function (machine) {
this.createTreeNode(bindingNode, machine);
}, this);
}, this);
arrayUtil.forEach(machines, function (machine) {
var machineNode = this.createTreeNode(serviceNode, machine);
arrayUtil.forEach(bindings, function (binding) {
this.createTreeNode(machineNode, binding);
}, this);
}, this);
data.push(serviceNode);
}, this);
}
break;
case "Debug":
data = arrayUtil.map(treeNode.__hpcc_treeItem.__hpcc_children, function (item) {
return this.createTreeNode(treeNode, item);
}, this);
break;
default:
break;
}
}
return QueryResults(this.queryEngine({}, {})(data));
},
示例2: function
removeSpillVertices: function () {
var vertices = arrayUtil.map(this.vertices, function (vertex) { return vertex; });
arrayUtil.forEach(vertices, function (vertex) {
if (vertex.isSpill()) {
vertex.remove();
}
}, this);
},
示例3: function
formatRows: function (columns, rows) {
return arrayUtil.map(rows, function (row) {
var rowFormatter = new RowFormatter(columns, row);
return rowFormatter.row();
});
}