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


TypeScript lodash.values函数代码示例

本文整理汇总了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;未经允许,请勿转载。