當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。