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


TypeScript Claim.getClaimId函数代码示例

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


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

示例1: claimIdShouldNotChangeWithAttributeKeyCasing

  @Test()
  @TestCase(TheRaven.attributes.name, TheRaven.attributes.author)
  @TestCase(TheMurdersInTheRueMorgue.attributes.name, TheMurdersInTheRueMorgue.attributes.author)
  @TestCase(AStudyInScarlet.attributes.name, AStudyInScarlet.attributes.author)
  public claimIdShouldNotChangeWithAttributeKeyCasing(name: string, author: string) {
    const work1: Claim = makeClaim({
      name,
      author,
    })
    const work2: Claim = makeClaim({
      Author: author,
      NAME: name,
    })

    Expect(getClaimId(work1)).toBe(getClaimId(work2))
  }
开发者ID:aconly,项目名称:poet-js,代码行数:16,代码来源:GetClaimId.ts

示例2: claimIdIncludesDate

 @Test()
 @TestCase(TheRaven)
 public claimIdIncludesDate(work: Work) {
   Expect(
     getClaimId({
       ...work,
       dateCreated: new Date(),
     })
   ).not.toBe(work.id)
 }
开发者ID:aconly,项目名称:poet-js,代码行数:10,代码来源:GetClaimId.ts

示例3: claimIdIncludesType

 @Test()
 @TestCase(TheRaven)
 public claimIdIncludesType(work: Work) {
   Expect(
     getClaimId({
       ...work,
       type: 'Asd' as ClaimType,
     })
   ).not.toBe(work.id)
 }
开发者ID:aconly,项目名称:poet-js,代码行数:10,代码来源:GetClaimId.ts

示例4: claimIdIncludesPublicKey

 @Test()
 @TestCase(TheRaven)
 public claimIdIncludesPublicKey(work: Work) {
   Expect(
     getClaimId({
       ...work,
       publicKey: '123',
     })
   ).not.toBe(work.id)
 }
开发者ID:aconly,项目名称:poet-js,代码行数:10,代码来源:GetClaimId.ts

示例5: claimIdIgnoresSignature

 @Test()
 @TestCase(TheRaven)
 public claimIdIgnoresSignature(work: Work) {
   // The field .signature is ignored in the calculation of the id
   const ignoreSignature = getClaimId({
     ...work,
     signature: '123',
   })
   Expect(ignoreSignature).toBe(work.id)
 }
开发者ID:aconly,项目名称:poet-js,代码行数:10,代码来源:GetClaimId.ts

示例6: claimIdIgnoresId

 @Test()
 @TestCase(TheRaven)
 public claimIdIgnoresId(work: Work) {
   // The field .id is ignored in the calculation of the id
   const ignoreId = getClaimId({
     ...work,
     id: '123',
   })
   Expect(ignoreId).toBe(work.id)
 }
开发者ID:aconly,项目名称:poet-js,代码行数:10,代码来源:GetClaimId.ts

示例7: claimId

 @Test()
 @TestCase(TheRaven)
 public claimId(work: Work) {
   const claimId = getClaimId(work)
   Expect(claimId).toBe(work.id)
 }
开发者ID:aconly,项目名称:poet-js,代码行数:6,代码来源:GetClaimId.ts


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