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


TypeScript underscore.range函数代码示例

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


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

示例1: map

 args.results.results.forEach(res => {
   const amountOfLike = Math.floor(Math.random() * 15);
   const likedBy = map(range(0, amountOfLike), val => val).join(';') || null;
   res.raw.sflikedby = likedBy;
   res.raw.sflikedbyid = likedBy;
   res.raw.sflikecount = amountOfLike;
 });
开发者ID:coveo,项目名称:search-ui,代码行数:7,代码来源:AccessibilityChatterLikedBy.ts

示例2: describe

      describe('game with last row full', ()=> {
        var game = new Models.Game(()=>{});
        game.rubble = _.range(1, game.cols+1).map(col => new Models.Point(game.rows, col));

        it('should have one completed row', ()=> assert.equal(1, game.completedRows().length));
        it('should have row 15 as completed', ()=> assert.equal(15, game.completedRows()[0]));
      });
开发者ID:kristianmandrup,项目名称:tetris,代码行数:7,代码来源:modelsTests.ts

示例3: getYearValues

 static getYearValues(futureDates: boolean, yearsFromNow = 110, startCap = 0) {
   let r = _.range(0, yearsFromNow).map(i => futureDates ? moment().add(i, 'years').year() : moment().subtract(i, 'years').year());
   if (startCap) {
     return futureDates ? _.reject(r, v => v < startCap) : _.reject(r, v => v > startCap);
   }
   return r;
 }
开发者ID:Rocketmakers,项目名称:armstrong-react,代码行数:7,代码来源:dateHelpers.ts

示例4: Cell

 _.each(_.range(this.size), (row:number) => {
     _.each(_.range(this.size), (column:number) => {
         this.cells.add(new Cell({
             row,
             column
         }));
     });
 });
开发者ID:joppe,项目名称:2048,代码行数:8,代码来源:Grid.ts

示例5: it

        it('replaces the tabs in the correct order in the original section', () => {
          simulateOverflowing();
          responsiveTabs.handleResizeEvent();
          simulateNotOverflowing();
          responsiveTabs.handleResizeEvent();

          range(0, 5).forEach(tabThatShouldBeInStandardSection => {
            expect(tabSection.find(`div[data-id="${tabThatShouldBeInStandardSection}"]`)).not.toBeNull();
          });
        });
开发者ID:coveo,项目名称:search-ui,代码行数:10,代码来源:ResponsiveTabsTest.ts

示例6: verifyChildren

 function verifyChildren(numberOfValues: number) {
   removeAllCategoriesButton(test.cmp.element);
   const categoryValues = $$(test.cmp.element).findAll('.coveo-category-facet-child-value');
   for (const i of range(0, numberOfValues)) {
     const valueCaption = $$(categoryValues[i]).find('.coveo-category-facet-value-caption');
     const valueCount = $$(categoryValues[i]).find('.coveo-category-facet-value-count');
     expect($$(valueCaption).text()).toEqual(`value${i}`);
     expect($$(valueCount).text()).toEqual('5');
   }
 }
开发者ID:francoislg,项目名称:search-ui,代码行数:10,代码来源:CategoryFacetTest.ts

示例7: verifyParents

 function verifyParents(numberOfParents: number) {
   removeAllCategoriesButton(test.cmp.element);
   const parentCategoryValues = $$(test.cmp.element).findAll('.coveo-category-facet-parent-value');
   for (const i of range(numberOfParents)) {
     const valueCaption = $$(parentCategoryValues[i]).find('.coveo-category-facet-value-caption');
     const valueCount = $$(parentCategoryValues[i]).find('.coveo-category-facet-value-count');
     expect($$(valueCaption).text()).toEqual(`parent${i}`);
     expect($$(valueCount).text()).toEqual('5');
   }
 }
开发者ID:francoislg,项目名称:search-ui,代码行数:10,代码来源:CategoryFacetTest.ts

示例8: constructor

    /**
     * Initialize the grid by creating the necessary cells.
     */
    constructor(attributes:GridLiteralInterface) {
        super(attributes);

        _.each(_.range(this.size), (row:number) => {
            _.each(_.range(this.size), (column:number) => {
                this.cells.add(new Cell({
                    row,
                    column
                }));
            });
        });
    }
开发者ID:joppe,项目名称:2048,代码行数:15,代码来源:Grid.ts

示例9: beforeEach

    beforeEach(() => {
      dataSource = range(0, 50).map(iterator => {
        return {
          value: {
            content: iterator.toString()
          }
        };
      });

      successSpy = jasmine.createSpy('successSpy');
      failSpy = jasmine.createSpy('failSpy');
      fieldsDataSource = new AvailableFieldsDatasource(dataSource);
    });
开发者ID:coveo,项目名称:search-ui,代码行数:13,代码来源:AvailableFieldsDatasourceTest.ts


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