本文整理汇总了TypeScript中underscore.contains函数的典型用法代码示例。如果您正苦于以下问题:TypeScript contains函数的具体用法?TypeScript contains怎么用?TypeScript contains使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了contains函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: assert
this._activateSession(internalSession, (err: Error | null /*, newSession?: ClientSessionImpl*/) => {
if (!err) {
if (old_client !== this) {
// remove session from old client:
if (old_client) {
old_client._removeSession(internalSession);
assert(!_.contains(old_client._sessions, internalSession));
}
this._addSession(internalSession);
assert(internalSession._client === this);
assert(!internalSession._closed, "session should not vbe closed");
assert(_.contains(this._sessions, internalSession));
}
callback();
} else {
// istanbul ignore next
if (doDebug) {
debugLog(chalk.red.bgWhite("reactivateSession has failed !"), err.message);
}
callback(err);
}
});
开发者ID:node-opcua,项目名称:node-opcua,代码行数:26,代码来源:opcua_client_impl.ts
示例2: function
angular.forEach(row, function (val:any, name:any) {
var displayName = name;
if (name.indexOf('.') >= 0) {
displayName = name.substring(name.indexOf('.') + 1);
}
if (hideColumns && (_.contains(hideColumns, displayName) || _.contains(hideColumns, name))) {
}
else {
displayColumns.push(displayName)
columns.push(name);
}
});
开发者ID:prashanthc97,项目名称:kylo,代码行数:13,代码来源:HiveService.ts
示例3: _removeSession
public _removeSession(session: ClientSessionImpl) {
const index = this._sessions.indexOf(session);
if (index >= 0) {
const s = this._sessions.splice(index, 1)[0];
assert(s === session);
assert(!_.contains(this._sessions, session));
assert(session._client === this);
session._client = null;
}
assert(!_.contains(this._sessions, session));
}
开发者ID:node-opcua,项目名称:node-opcua,代码行数:13,代码来源:client_base_impl.ts
示例4: validateTeam
private static validateTeam(days: Date[], team: TeamModel, daysOfWeek: string[]): string {
for (let byeDay of team.byes) {
if (!_.contains(days, byeDay)) {
return "Team " + team.teamName + " requested bye " +
DateUtils.niceStringForDate(byeDay) +
", but that is not a day when games are scheduled.";
}
}
if (team.badDayOfWeek && !_.contains(daysOfWeek, team.badDayOfWeek.toLowerCase())) {
return "Team " + team.teamName + " asked for no games on " +
team.badDayOfWeek + "s, but that is not a day of the week when games on scheduled.";
}
return "";
}
开发者ID:dlev-,项目名称:LeagueScheduler,代码行数:14,代码来源:ScheduleValidator.ts
示例5: each
each(indexQuerySection.result.in, (paramValue: string, paramKey: string) => {
const row = $$('tr');
table.append(row.el);
const id = `executionReportIndexExecution${paramKey}`;
if (contains(collapsibleSectionsInReport, paramKey) && paramValue) {
const btn = $$(
'button',
{
className: 'coveo-button'
},
paramKey
);
const tdTarget = $$(
'td',
{
id,
className: 'coveo-relevance-inspector-effective-query-collapsible'
},
new GenericValueOutput().output(paramValue).content
);
btn.on('click', () => {
tdTarget.toggleClass('coveo-active');
});
row.append($$('td', undefined, btn).el);
row.append(tdTarget.el);
} else {
row.append($$('td', undefined, paramKey).el);
row.append($$('td', undefined, new GenericValueOutput().output(paramValue).content).el);
}
});
开发者ID:coveo,项目名称:search-ui,代码行数:35,代码来源:ExecutionReportEffectiveIndexQuerySection.ts
示例6: function
storage.get('queries', function(error, queries) {
if (error) {
console.error(error);
} else {
if (_.contains(_.map(queries, (q: QueryEntry) => { return q.name; }), $name.val())) {
pushResponse($resp, 'Key already exists.');
} else {
if (_.isEmpty(queries)) {
queries = [];
}
queries.push({
name: $name.val(),
collection: $collection.val(),
query: $query.val()
});
storage.set('queries', queries, function(error) {
if (error) {
console.error(error);
} else {
pushResponse($resp, 'Entry added successfully.');
}
});
}
}
});
开发者ID:hack-rpi,项目名称:Email-Board,代码行数:25,代码来源:query-dialog.ts
示例7: onToggleAlaCarte
onToggleAlaCarte(alaCarteId: string) {
if(_.contains(this.selectedAlaCarteIds, alaCarteId)){
this.selectedAlaCarteIds =
_.without(this.selectedAlaCarteIds, alaCarteId);
} else {
this.selectedAlaCarteIds.push(alaCarteId);
}
}
开发者ID:SkillitCooking,项目名称:app1.0,代码行数:8,代码来源:cook-select.ts
示例8: update
/**
* Update the contents of this view
*
* Called when the model is changed. The model may have been
* changed by another view or by a state update from the back-end.
*/
update() {
super.update();
var selected = this.model.get('value') || [];
var values = _.map(selected, encodeURIComponent);
var options = this.listbox.options;
for (var i = 0, len = options.length; i < len; ++i) {
var value = options[i].getAttribute('data-value');
options[i].selected = _.contains(values, value);
}
}
开发者ID:dmadeka,项目名称:ipywidgets,代码行数:16,代码来源:widget_selection.ts
注:本文中的underscore.contains函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论