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