本文整理匯總了TypeScript中dojo/_base/lang.exists函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript exists函數的具體用法?TypeScript exists怎麽用?TypeScript exists使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了exists函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: function
constructor: function (args) {
if (args) {
declare.safeMixin(this, args);
}
if (lang.exists("Sequence", this)) {
this.store = new Store({
wuid: this.Wuid,
sequence: this.Sequence,
isComplete: this.isComplete()
});
} else if (lang.exists("Name", this) && lang.exists("NodeGroup", this)) {
this.store = new Store({
wuid: this.Wuid,
cluster: this.NodeGroup,
name: this.Name,
isComplete: true
});
} else {
this.store = new Store({
wuid: this.Wuid,
cluster: this.Cluster,
name: this.Name,
isComplete: true
});
}
},
示例2: function
arrayUtil.some(item.Clusters.ClusterQueryState, function (cqs, idx) {
if (lang.exists("Errors", cqs) && cqs.Errors || cqs.State !== "Available") {
ErrorCount++;
StatusMessage = context.i18n.SuspendedByCluster;
return false;
}
if (lang.exists("MixedNodeStates", cqs) && cqs.MixedNodeStates === true) {
StatusMessage = context.i18n.MixedNodeStates;
MixedNodeStates = true;
}
});
示例3: switch
return this._send(service, action, params).then(function (response) {
if (handleAs === "json") {
if (lang.exists("Exceptions.Source", response) && !params.skipExceptions) {
var severity = params.suppressExceptionToaster ? "Info" : "Error";
var source = service + "." + action;
if (lang.exists("Exceptions.Exception", response) && response.Exceptions.Exception.length === 1) {
switch (source) {
case "WsWorkunits.WUInfo":
if (response.Exceptions.Exception[0].Code === 20080) {
severity = "Info";
}
break;
case "WsWorkunits.WUQuery":
if (response.Exceptions.Exception[0].Code === 20081) {
severity = "Info";
}
break;
case "WsWorkunits.WUCDebug":
if (response.Exceptions.Exception[0].Code === -10) {
severity = "Info";
}
break;
case "FileSpray.GetDFUWorkunit":
if (response.Exceptions.Exception[0].Code === 20080) {
severity = "Info";
}
break;
case "WsDfu.DFUInfo":
if (response.Exceptions.Exception[0].Code === 20038) {
severity = "Info";
}
break;
case "WsWorkunits.WUUpdate":
if (response.Exceptions.Exception[0].Code === 20049) {
severity = "Error";
}
break;
}
}
topic.publish("hpcc/brToaster", {
Severity: severity,
Source: source,
Exceptions: response.Exceptions.Exception
});
}
}
return response;
},
示例4: onFetchGraphXgmml
}).then(function (response) {
if (lang.exists("WUGetGraphResponse.Graphs.ECLGraphEx", response) && response.WUGetGraphResponse.Graphs.ECLGraphEx.length) {
if (subGraphId) {
if (!context.subgraphs) {
context.subgraphs = {};
}
if (!context.subgraphs[idx + "." + subGraphId]) {
context.subgraphs[idx + "." + subGraphId] = {};
}
context.subgraphs[idx + "." + subGraphId].xgmml = "<graph>" + response.WUGetGraphResponse.Graphs.ECLGraphEx[0].Graph + "</graph>";
onFetchGraphXgmml(context.subgraphs[idx + "." + subGraphId].xgmml, context.subgraphs[idx + "." + subGraphId].svg);
} else {
context.graphs[idx].xgmml = response.WUGetGraphResponse.Graphs.ECLGraphEx[0].Graph;
onFetchGraphXgmml(context.graphs[idx].xgmml, context.graphs[idx].svg);
}
} else {
topic.publish("hpcc/brToaster", {
Severity: "Error",
Source: "ESPWorkunit.fetchGraphXgmml",
Exceptions: [
{ Message: context.i18n.FetchingXGMMLFailed }
]
});
onFetchGraphXgmml("", "");
}
});
示例5: function
_TpEclAgentsSetter: function (TpEclAgents) {
if (lang.exists("TpEclAgent", TpEclAgents)) {
arrayUtil.forEach(TpEclAgents.TpEclAgent, function (item, idx) {
this.appendChild(createTreeItem(TpEclAgent, item.Name, this, item));
}, this);
}
},
示例6: function
}).then(function (response) {
var newRows = [];
if (lang.exists("DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File", response)) {
var results = response.DFUXRefOrphanFilesQueryResponse.DFUXRefOrphanFilesQueryResult.File
if (results.length) {
arrayUtil.forEach(results, function (row, idx) {
newRows.push({
Name: row.Partmask,
Modified: row.Modified,
PartsFound: row.Partsfound,
TotalParts: row.Numparts,
Size: row.Size
});
});
} else if (results.Partmask) {
newRows.push({
Name: results.Partmask,
Modified: results.Modified,
PartsFound: results.Partsfound,
TotalParts: results.Numparts,
Size: results.Size
});
}
}
return newRows;
});
示例7:
}).then(function (response) {
var retVal = [];
if (lang.exists("TpServiceQueryResponse.ServiceList", response)) {
retVal.push(createTreeItem(Services, "Services", context.rootItem, response.TpServiceQueryResponse.ServiceList));
}
return retVal;
})
示例8: function
load: function (response) {
if (lang.exists("WUActionResponse.ActionResults.WUActionResult", response)) {
var wuMap = {};
arrayUtil.forEach(workunits, function (item, index) {
wuMap[item.Wuid] = item;
});
arrayUtil.forEach(response.WUActionResponse.ActionResults.WUActionResult, function (item, index) {
if (item.Result.indexOf("Failed:") === 0) {
topic.publish("hpcc/brToaster", {
Severity: "Error",
Source: "WsWorkunits.WUAction",
Exceptions: [{ Source: item.Action + " " + item.Wuid, Message: item.Result }]
});
} else {
var wu = wuMap[item.Wuid];
if (actionType === "delete" && item.Result === "Success") {
wu.set("StateID", 999);
wu.set("State", "not found");
} else if (wu.refresh) {
wu.refresh();
}
}
});
}
if (callback && callback.load) {
callback.load(response);
}
},