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


TypeScript lodash.some函数代码示例

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


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

示例1: function

 .filter(function(oa) {
     return _.some(oa.vuosiluokkakokonaisuudet, function(oavkl: any) {
         return _.parseInt(oavkl._vuosiluokkaKokonaisuus) === vkl.id;
     });
 })
开发者ID:Opetushallitus,项目名称:eperusteet,代码行数:5,代码来源:perusopetus.ts

示例2: occupied

 get occupied(): boolean {
     return _.some(this.items, it => it.occupied);
 }
开发者ID:Gitjerryzhong,项目名称:bell-tm-static,代码行数:3,代码来源:form.model.ts

示例3: function

 $scope.filterRyhma = function(ryhma) {
     return _.some(ryhma, $scope.filterJasen);
 };
开发者ID:Opetushallitus,项目名称:eperusteet,代码行数:3,代码来源:sisalto.ts

示例4: function

 $scope.$watch('$ctrl.user', function(user) {
   if (user && user.id) {
     ctrl.doesUserStar = some(ctrl.stars, {'id': user.id});
   }
 });
开发者ID:carolinagc,项目名称:paperhive-frontend,代码行数:5,代码来源:star-button.ts

示例5:

 return _.filter(meetings, meeting =>
     _.some(areaDistrictCheckModel, key => key.Truthy && key.Area === meeting.Area && key.District === meeting.District));
开发者ID:disco-funk,项目名称:ca-london-angular,代码行数:2,代码来源:district.filter.ts

示例6: it

 it('should have 2 items in the "application" cache when we remove "foo" by application name', () => {
   RecentHistoryService.removeByAppName('foo');
   const items = RecentHistoryService.getItems('applications');
   expect(items.length).toBe(2);
   expect(some(items, { params: { application: 'foo' } })).toBeFalsy();
 });
开发者ID:emjburns,项目名称:deck,代码行数:6,代码来源:recentHistory.service.spec.ts

示例7:

      );

      if (actualDistance > weaponStack.item.range) {
        return {
          isValid: false,
          error: `${targetPlayer.name} is out of ${weaponStack.item.name}'s attack range!`
        };
      }

      // check that gun shot is in a straight line and unobstructed
      if (targetPlayer.character.row === actor.row || targetPlayer.character.col === actor.col) {
        const cellsInBetween = Cell.getPositionsBetween(
          targetPlayer.character, actor
        ).map(pos => Map.getCell(game.map, pos));

        if (_.some(cellsInBetween, cell => Cell.isBarrier(cell))) {
          return {
            isValid: false,
            error: `Your shot is obstructed by a barrier!`
          };
        } else {
          // ok
        }
      } else {
        return {
          isValid: false,
          error: `You can only shoot in straight lines!`
        };
      }

      // now check that if the player is attacking with a gun, that they have the bullets required
开发者ID:zthomae,项目名称:xanadu,代码行数:31,代码来源:actions.ts

示例8: isFocused

 const isFocusedSuite = (suite) => isFocused(suite) || some(suite, isFocused);
开发者ID:JamieMason,项目名称:karma-benchmark,代码行数:1,代码来源:process-benchmarks.ts

示例9: onFilterInterests

 onFilterInterests(data: Person, searchValue: any): boolean {
   return _.some(data.interests, {id: Number(searchValue)});
 }
开发者ID:raketasoft,项目名称:ng2-grid,代码行数:3,代码来源:demo.component.ts

示例10: if

        if (fileExts.indexOf(path.extname(file)) > -1) {
          state.files.push(file)
        }
      } else if (stat.isDirectory()) {
        state.dirs.push(file)
      } else {
        console.error(`unknown file ${file}`)
      }
      cb(null, state)
    })
  },
  readDirectory(dir: string, cb: {(err: Error | null, dirState: DirState | null)}) {
    fs.readdir(dir, (err, files) => {
      if (err) return cb(err, null)
      files = files.filter((f) => !noProcessRegex.test(f)).map((f) => path.join(dir, f))
      const dirFiles: DirState = {baseDir: dir, files: [], dirs: []}
      async.reduce(files, dirFiles, genUtil.seperateDirFiles.bind(genUtil, validExts), (err, state) => {
        if (err) return cb(err, null)
        state.files = state.files.sort()
        state.dirs = state.dirs.sort()
        cb(null, state)
      })
    })
  },
  matchesOne(file: string, regexps: RegExp[]): boolean {
    return _.some(regexps, (r) => r.test(file))
  }
}

export { genUtil }
开发者ID:instructure,项目名称:ftl-engine,代码行数:30,代码来源:util.ts


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