• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript lodash.values函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中lodash.values函数的典型用法代码示例。如果您正苦于以下问题:TypeScript values函数的具体用法?TypeScript values怎么用?TypeScript values使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了values函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: describe

    describe('sorting', () => {
        let orderedStatuses = _.values(STATUS_TYPES).sort();

        it('should support sorting ascending', () => {
            tablePageObject.statusColumn.sortAscending();
            expect(tablePageObject.getStatuses()).to.eventually.eql(orderedStatuses);
        });

        it('should support sorting descending', () => {
            tablePageObject.statusColumn.sortDescending();
            expect(tablePageObject.getStatuses()).to.eventually.eql(orderedStatuses.reverse());
        });

    });
开发者ID:Droogans,项目名称:encore-ui,代码行数:14,代码来源:rxStatusCell.midway.ts


示例2: uniqueGenomicLocations

export function uniqueGenomicLocations(mutations: Mutation[]): GenomicLocation[]
{
    const genomicLocationMap: {[key: string]: GenomicLocation} = {};

    mutations.map((mutation: Mutation) => {
        const genomicLocation: GenomicLocation|undefined = extractGenomicLocation(mutation);

        if (genomicLocation) {
            genomicLocationMap[genomicLocationString(genomicLocation)] = genomicLocation;
        }
    });

    return _.values(genomicLocationMap);
}
开发者ID:agarwalrounak,项目名称:cbioportal-frontend,代码行数:14,代码来源:MutationUtils.ts


示例3: transform

  transform(bundle: { [bundleVersion: string]: PropertyQuery } ): { title: string; fields: string[]; expanded?: boolean; }[] {
    // Get a nested array of EndpointQueries
    const arr: EndpointQuery[][] = values(bundle).map((propertyQuery: PropertyQuery) => propertyQuery.endpoints);

    // Reformat for easy parsing in the template
    return flatten(arr).map((endpointQuery: EndpointQuery) => {
      return {
        title: endpointQuery.endpoint.replace('/', ' '),
        fields: endpointQuery.mapping ?
          uniqBy(Object.keys(endpointQuery.mapping), path => path.split('.')[0]).map(name => name.replace(/_/g, ' '))
          : ['NONE']
      };
    });
  }
开发者ID:Hub-of-all-Things,项目名称:Rumpel,代码行数:14,代码来源:unbundle.pipe.ts


示例4: paivitaSivunavi

        function paivitaSivunavi() {
            var navi = {
                oppiaineet: []
            };
            _.forEach(_.values(oppiaineet), function(oa) {
                navi.oppiaineet.push(oa);
            });

            _.each($scope.navi.sections[2].model.sections, function(v) {
                if (navi[v.id]) {
                    v.items = navi[v.id];
                }
            });
        }
开发者ID:Opetushallitus,项目名称:eperusteet,代码行数:14,代码来源:perusopetus.ts


示例5: startCron

  startCron(opts, cb) {
    opts = opts || {};

    this.providers = _.values(require('./fiatrateproviders'));
    const interval = opts.fetchInterval || Defaults.FIAT_RATE_FETCH_INTERVAL;
    if (interval) {
      this._fetch();
      setInterval(() => {
        this._fetch();
      }, interval * 60 * 1000);
    }

    return cb();
  }
开发者ID:bitpay,项目名称:bitcore,代码行数:14,代码来源:fiatrateservice.ts


示例6: BlockChainExplorer

        (done) => {
          this.explorers = {
            btc: {},
            bch: {}
          };

          const coinNetworkPairs = [];
          _.each(_.values(Constants.COINS), (coin) => {
            _.each(_.values(Constants.NETWORKS), (network) => {
              coinNetworkPairs.push({
                coin,
                network
              });
            });
          });
          _.each(coinNetworkPairs, (pair) => {
            let explorer;
            if (
              opts.blockchainExplorers &&
              opts.blockchainExplorers[pair.coin] &&
              opts.blockchainExplorers[pair.coin][pair.network]
            ) {
              explorer = opts.blockchainExplorers[pair.coin][pair.network];
            } else {
              let config: { url?: string; provider?: any } = {};
              if (
                opts.blockchainExplorerOpts &&
                opts.blockchainExplorerOpts[pair.coin] &&
                opts.blockchainExplorerOpts[pair.coin][pair.network]
              ) {
                config = opts.blockchainExplorerOpts[pair.coin][pair.network];
              } else {
                return;
              }

              explorer = BlockChainExplorer({
                provider: config.provider,
                coin: pair.coin,
                network: pair.network,
                url: config.url,
                userAgent: WalletService.getServiceVersion()
              });
            }
            $.checkState(explorer);
            this._initExplorer(pair.coin, pair.network, explorer);
            this.explorers[pair.coin][pair.network] = explorer;
          });
          done();
        },
开发者ID:bitpay,项目名称:bitcore,代码行数:49,代码来源:blockchainmonitor.ts


示例7: getDuplicateModules

export function getDuplicateModules(classes: VenueLesson[]): ModuleCode[] {
  const lessonsByTime: VenueLesson[][] = values(
    groupBy(classes, (lesson) => [lesson.startTime, lesson.endTime, lesson.weeks, lesson.day]),
  );

  for (const lessons of lessonsByTime) {
    if (lessons.length > 1) {
      // Occasionally two classes share the same venue, so we don't count those
      const moduleCodes = uniq(lessons.map((lesson) => lesson.moduleCode));
      if (uniq(moduleCodes).length > 1) return moduleCodes;
    }
  }

  return [];
}
开发者ID:nusmodifications,项目名称:nusmods,代码行数:15,代码来源:data.ts


示例8: aggregateStatementStats

export function aggregateStatementStats(statementStats: CollectedStatementStatistics[]) {
  const statementsMap: { [statement: string]: CollectedStatementStatistics[] } = {};
  statementStats.forEach(
    (statement: CollectedStatementStatistics) => {
      const matches = statementsMap[statement.key.key_data.query] || (statementsMap[statement.key.key_data.query] = []);
      matches.push(statement);
  });

  return _.values(statementsMap).map(statements =>
    _.reduce(statements, (a: CollectedStatementStatistics, b: CollectedStatementStatistics) => ({
      key: a.key,
      stats: addStatementStats(a.stats, b.stats),
    })),
  );
}
开发者ID:a6802739,项目名称:cockroach,代码行数:15,代码来源:appStats.ts


示例9: createAndSendQuery

  createAndSendQuery(silent) {
    // Create a query with all the current filters
    let query = _.values(_.mapValues(this.fields, function(value) { return value.query; })).join(' AND ');

    // Update the query parameter
    if (!silent) {
      this.$state.transitionTo(
        this.$state.current,
        _.merge(this.$state.params, {
          q: query
        }),
        {notify: false});
      this.onFilterChange({query: query, widget: this.lastSource});
    }
  }
开发者ID:gravitee-io,项目名称:gravitee-management-webui,代码行数:15,代码来源:dashboard-filter.controller.ts


示例10:

                calculated: (entityUsage) => {

                  let count_values = _.uniq(entityUsage.map(e => e.total_count));
                  let barResults = {};

                  let results = entityUsage.forEach(entity => {
                    barResults[entity.entityType] = barResults[entity.entityType] || { entityType: entity.entityType };
                    barResults[entity.entityType][entity.total_count] = entity.entity_count;
                  });

                  return {
                    "entities-usage": _.values(barResults),
                    "entities-usage-bars": count_values
                  };
                }
开发者ID:kishoreBhojan,项目名称:ibex-dashboard,代码行数:15,代码来源:MBF.Advanced.Health.ts



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript lodash.valuesIn函数代码示例发布时间:2022-05-25
下一篇:
TypeScript lodash.upperFirst函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap