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


TypeScript object-hash.default函数代码示例

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


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

示例1: beforeEach

        beforeEach(() => {
            mockConnectionProfile = {name: 'myProfile'};
            mockConnectionProfile2 = {name: 'myOtherProfile'};

            mockIdCard1 = sinon.createStubInstance(IdCard);
            mockIdCard1.getUserName.returns('card1');
            mockIdCard1.getConnectionProfile.returns(mockConnectionProfile);
            mockIdCard1.getRoles.returns(['myRole']);

            mockIdCard2 = sinon.createStubInstance(IdCard);
            mockIdCard2.getUserName.returns('card2');
            mockIdCard2.getConnectionProfile.returns(mockConnectionProfile);
            mockIdCard2.getRoles.returns(['myOtherRole']);

            mockIdCard3 = sinon.createStubInstance(IdCard);
            mockIdCard3.getUserName.returns('card3');
            mockIdCard3.getConnectionProfile.returns(mockConnectionProfile);
            mockIdCard3.getRoles.returns(['myRole']);

            mockIdCard4 = sinon.createStubInstance(IdCard);
            mockIdCard4.getUserName.returns('card4');
            mockIdCard4.getConnectionProfile.returns(mockConnectionProfile2);
            mockIdCard4.getRoles.returns(['myRole']);

            mockCardMap = new Map<string, IdCard>();
            mockCardMap.set('uuid1xxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', mockIdCard1);
            mockCardMap.set('uuid2xxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', mockIdCard2);
            mockCardMap.set('uuid3xxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', mockIdCard3);
            mockCardMap.set('uuid4xxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx', mockIdCard4);

            connectionProfileName = hash(mockConnectionProfile) + '-myProfile';
            connectionProfileName2 = hash(mockConnectionProfile2) + '-myOtherProfile';
        });
开发者ID:marlonprudente,项目名称:composer,代码行数:33,代码来源:identity-card.service.spec.ts

示例2: function

 register(reducer:Reducer):Reducer{
     let routeStateHistory:RouteStateHistory=new RouteStateHistory(hash(reducer));
     this.routeStates.push(routeStateHistory);
     return function (state,action) {
         if(action.type==ROUTE_STATE_CHANGE){
             let payload:IRouteStateChangeActionPayload=action.payload;
             switch (payload.action){
                 case RouteStatePushAction:
                     routeStateHistory.push();
                     break;
                 case RouteStatePopAction:
                     routeStateHistory.pop(payload.number);
                     break;
                 case RouteStateReplaceAction:
                     routeStateHistory.pop(1);
                     routeStateHistory.push();
                     break;
             }
             return routeStateHistory.state;
         }
         let newState=reducer(state,action);
         if(newState!=state){
             routeStateHistory.update(newState);
         }
         return newState;
     };
 }
开发者ID:guoyu07,项目名称:react-node-cms,代码行数:27,代码来源:route-state.ts

示例3: it

        it('should get a qualified profile name for other connection profiles', inject([IdentityCardService], (service: IdentityCardService) => {
            let connectionProfile = {
                name: 'hlfv1'
            };

            let qualifiedName = service.getQualifiedProfileName(connectionProfile);

            qualifiedName.should.equal(hash(connectionProfile) + '-hlfv1');
        }));
开发者ID:marlonprudente,项目名称:composer,代码行数:9,代码来源:identity-card.service.spec.ts

示例4: add

 add(item: fileCommon.IFile) {
     let hash_key = hash(item);
     this.container.set(hash_key, item);
 }
开发者ID:KnisterPeter,项目名称:gerrit-vscode,代码行数:4,代码来源:basicFileContainer.ts

示例5: hash

 labels.map(label =>
   label.set("id", hash(label.get("name").toLowerCase()))
开发者ID:alex3165,项目名称:github-issues,代码行数:2,代码来源:issues.ts

示例6: hashArgs

 private hashArgs(prices, budget) {
   return hash(hash(prices.toJS()) + hash(budget));
 }
开发者ID:Ethan826,项目名称:tablexi-coding-challenge,代码行数:3,代码来源:knapsack.ts

示例7: createSnapshotIfMissing

  describe(title, function(): void {
    const prompt: Options = Object.assign({}, _options.prompt);
    const scratchDir = path.join(__dirname, "../../../scratch");
    const snapshotDir = path.join(__dirname, "../../../snapshots");
    const hash = objectHash(Object.assign({ command }, prompt));
    const hashDir = path.join(snapshotDir, hash);

    this.timeout(5000);

    before(function(): Promise<void> {
      this.cwd = process.cwd();

      this.end = new Promise(
        (resolve, reject): void => {
          this.runContext = helpers
            .run(path.join(__dirname, `../../../generators/${name}`), {
              tmpdir: false
            })
            .inDir(scratchDir)
            .withArguments(args)
            .withPrompts(prompt)
            .on(
              "ready",
              // We don't want to import any source statically, so can't import
              // type BaseGenerator
              // @ts-ignore
              (generator): void => {
                // .yo-rc.json is in topdir and yeoman-test silently resets
                // cwd to topdir (because of sinonjs masking the warning)
                // so override the reset
                generator.destinationRoot(scratchDir);

                // Also override the reset for every single subgen
                // @ts-ignore
                generator._composedWith.forEach(
                  // We don't want to import any source statically, so can't import
                  // type BaseGenerator
                  // @ts-ignore
                  (gen): void => {
                    gen.destinationRoot(scratchDir);
                  }
                );
              }
            )
            .on("end", resolve)
            .on("error", reject)
            .toPromise();
        }
      );

      return this.runContext;
    });

    after(function(): void {
      return this.end.then(
        (): void => {
          process.chdir(this.cwd);
          // Dynamic loading because the config package is linked
          // statically via common/config.ts so it can't acknowledge the
          // redefinition of process.env["NODE_CONFIG_DIR"] if any src is
          // linked statically (they all import indirectly common/config.ts)
          require("../../../generators/common/base-generator").reset();
        }
      );
    });

    const assertContent = Object.assign(
      {
        "package.json": true,
        LICENSE: true,
        "README.md": false
      },
      _options.assertContent
    );

    Object.keys(assertContent).forEach(
      (key): void => {
        if (typeof assertContent[key] === "function") {
          assertContent[key] = (assertContent[key] as Function)();
        }
      }
    );

    const invalidFiles = (_options.expectInvalid || []).concat();

    const {
      matchFiles,
      snapshotFiles,
      expectedFiles,
      noFiles
    } = extractTestParameters(assertContent as {
      [k: string]: RegExp[] | true;
    });

    const validInput = invalidFiles.length === 0;

    if (validInput) {
      it("should create only the expected files", async (): Promise<void> => {
        let files = await readdir(scratchDir);

//.........这里部分代码省略.........
开发者ID:jlenoble,项目名称:generator-wupjs,代码行数:101,代码来源:test-generator.ts


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