本文整理匯總了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();
});
}