当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript lodash.xor函数代码示例

本文整理汇总了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();
  }
}
开发者ID:ornicar,项目名称:lichobile,代码行数:7,代码来源:socket.ts

示例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));
    }
}
开发者ID:agarwalrounak,项目名称:cbioportal-frontend,代码行数:20,代码来源:DeltaUtils.ts

示例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;
  }
开发者ID:mizzy,项目名称:deck,代码行数:37,代码来源:serverGroupConfiguration.service.ts

示例4:

const setEquals = <T>(array1: T[], array2: T[]) =>
  _.xor(array1, array2).length === 0;
开发者ID:tessenate,项目名称:polyhedra-viewer,代码行数:2,代码来源:augment.ts

示例5: isCupolaRotunda

function isCupolaRotunda(baseType: string, augmentType: string) {
  return _.xor(['cupola', 'rotunda'], [baseType, augmentType]).length === 0;
}
开发者ID:tessenate,项目名称:polyhedra-viewer,代码行数:3,代码来源:augment.ts


注:本文中的lodash.xor函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。