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


TypeScript to-boolean类代码示例

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


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

示例1:

#!/usr/bin/env node

import './ts-paths-bootstrap'

import { AppInsights } from 'modules/app-insights'
// App Insights needs to be enabled as early as possible as it monitors other libraries as well
AppInsights.enable()

import * as config from 'config'
import * as toBoolean from 'to-boolean'

import { app } from './app'
import { ApplicationCluster } from './applicationCluster'
import { ApplicationRunner } from './applicationRunner'

if (toBoolean(config.get<boolean>('featureToggles.clusterMode'))) {
  ApplicationCluster.execute(() => ApplicationRunner.run(app))
} else {
  ApplicationRunner.run(app)
}
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:20,代码来源:server.ts

示例2: fromObject

  static fromObject (value?: any): OtherDependants {
    if (!value) {
      return value
    }

    const declared: boolean = value.declared !== undefined ?
      toBoolean(value.declared) : undefined

    return new OtherDependants(
      declared,
      declared ? NumberOfPeople.fromObject(value.numberOfPeople) : undefined
    )
  }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:13,代码来源:otherDependants.ts

示例3: it

 it('should return toggle value if testingSupport toggle exists', () => {
   const expectedToggleValue: boolean = toBoolean(config.get<boolean>(`featureToggles.testingSupport`))
   expect(FeatureToggles.isEnabled('testingSupport')).to.equal(expectedToggleValue)
 })
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:4,代码来源:featureToggles.ts

示例4: fromObject

 static fromObject (value?: any): Declaration {
   if (!value) {
     return value
   }
   return new Declaration(value.signed && toBoolean(value.signed))
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:6,代码来源:declaration.ts

示例5: fromObject

 static fromObject (value?: any): SettlementAgreement {
   if (!value) {
     return value
   }
   return new SettlementAgreement(value.signed && toBoolean(value.signed))
 }
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:6,代码来源:settlementAgreement.ts

示例6: toBoolean

 return Object.keys(featureToggles).reduce((result: { [key: string]: boolean }, property: string) => {
   result[property] = toBoolean(Object.getOwnPropertyDescriptor(featureToggles, property).value)
   return result
 }, {})
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:4,代码来源:index.ts

示例7: toBoolean

 .some((featureName) => toBoolean(config.get<boolean>(`featureToggles.${featureName}`)))
开发者ID:hmcts,项目名称:cmc-citizen-frontend,代码行数:1,代码来源:featureToggles.ts


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