本文整理汇总了TypeScript中lodash.xor函数的典型用法代码示例。如果您正苦于以下问题:TypeScript xor函数的具体用法?TypeScript xor怎么用?TypeScript xor使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了xor函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: handleFollowingOnline
function handleFollowingOnline(data: Array<string>) {
const curList = friendsApi.list();
friendsApi.set(data);
if (xor(curList, data).length > 0) {
redraw();
}
}
示例2: transitionTrackGroupSortPriority
export function transitionTrackGroupSortPriority(
nextProps: TrackSpecsWithDynamicGroups,
prevProps: Partial<TrackSpecsWithDynamicGroups>,
oncoprint: OncoprintJS<any>
) {
const prevHeatmapTrackGroups = _.sortBy(_.uniq(
(prevProps.heatmapTracks || [])
.concat(prevProps.genesetHeatmapTracks || [])
.map(x => x.trackGroupIndex)
));
const nextHeatmapTrackGroups = _.sortBy(_.uniq(
nextProps.heatmapTracks
.concat(nextProps.genesetHeatmapTracks)
.map(x=>x.trackGroupIndex)
));
if (_.xor(nextHeatmapTrackGroups, prevHeatmapTrackGroups).length) {
// if track groups have changed
oncoprint.setTrackGroupSortPriority([CLINICAL_TRACK_GROUP_INDEX].concat(nextHeatmapTrackGroups).concat(GENETIC_TRACK_GROUP_INDEX));
}
}
示例3: configureLoadBalancerOptions
public configureLoadBalancerOptions(command: IEcsServerGroupCommand): IServerGroupCommandResult {
const result: IEcsServerGroupCommandResult = { dirty: {} };
const currentLoadBalancers = (command.loadBalancers || []).concat(command.vpcLoadBalancers || []);
// const currentTargetGroups = command.targetGroup || [];
const newLoadBalancers = this.getLoadBalancerNames(command);
const vpcLoadBalancers = this.getVpcLoadBalancerNames(command);
const allTargetGroups = this.getTargetGroupNames(command);
if (currentLoadBalancers && command.loadBalancers) {
const valid = command.vpcId ? newLoadBalancers : newLoadBalancers.concat(vpcLoadBalancers);
const matched = intersection(valid, currentLoadBalancers);
const removedLoadBalancers = xor(matched, currentLoadBalancers);
command.loadBalancers = intersection(newLoadBalancers, matched);
if (!command.vpcId) {
command.vpcLoadBalancers = intersection(vpcLoadBalancers, matched);
} else {
delete command.vpcLoadBalancers;
}
if (removedLoadBalancers.length) {
result.dirty.loadBalancers = removedLoadBalancers;
}
}
// if (currentTargetGroups && command.targetGroup) {
// const matched = intersection(allTargetGroups, currentTargetGroups);
// const removedTargetGroups = xor(matched, currentTargetGroups);
// command.targetGroup = intersection(allTargetGroups, matched);
// if (removedTargetGroups.length) {
// result.dirty.targetGroup = removedTargetGroups;
// }
// }
command.backingData.filtered.loadBalancers = newLoadBalancers;
command.backingData.filtered.vpcLoadBalancers = vpcLoadBalancers;
command.backingData.filtered.targetGroups = allTargetGroups;
return result;
}
示例4:
const setEquals = <T>(array1: T[], array2: T[]) =>
_.xor(array1, array2).length === 0;
示例5: isCupolaRotunda
function isCupolaRotunda(baseType: string, augmentType: string) {
return _.xor(['cupola', 'rotunda'], [baseType, augmentType]).length === 0;
}