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


TypeScript lodash.forIn函数代码示例

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


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

示例1: it

 it('should test if all messages methods are defined', () => {
   _.forIn(service.messages, (value, key) => {
     expect(value.descr({})).toBeTruthy();
     expect(value.success({})).toBeTruthy();
     expect(value.error({})).toBeTruthy();
   });
 });
开发者ID:hzhang-wx,项目名称:ceph,代码行数:7,代码来源:task-manager-message.service.spec.ts

示例2: handleQueries

 function handleQueries(component: any) {
   forIn(queries(component), (options, queryName: string) => {
     if (!equalVariablesOf(queryName, options.variables)) {
       createQuery(component, queryName, options);
     }
   });
 }
开发者ID:jboothe,项目名称:angular2-apollo,代码行数:7,代码来源:apolloDecorator.ts

示例3: handleQueries

 function handleQueries(component: any) {
   forIn(queries(component), ({ query, variables }, queryName: string) => {
     if (!equalVariablesOf(queryName, variables)) {
       createQuery(component, queryName, { query, variables });
     }
   });
 }
开发者ID:hlehmann,项目名称:angular2-apollo,代码行数:7,代码来源:apolloDecorator.ts

示例4: ngOnInit

  ngOnInit() {
    const fg = {};
    this.helpText = this.iscsiService.targetAdvancedSettings;

    _.forIn(this.target_default_controls, (value, key) => {
      fg[key] = new FormControl(this.target_controls.value[key]);
    });

    this.settingsForm = new CdFormGroup(fg);
  }
开发者ID:IlsooByun,项目名称:ceph,代码行数:10,代码来源:iscsi-target-iqn-settings-modal.component.ts

示例5: test

 function test(params, wanted) {
     const r = compute(params.attrs, params.prev_defaults, params.v);
     //console.log('attrs:' + JSON.stringify(r.attrs));
     //console.log('v:' + JSON.stringify(params.v));
     if (wanted.attrNames) assert.equal(Object.keys(r.attrs).sort().join(' '), wanted.attrNames);
     forIn(wanted.subAttrs || {}, (opts, k) => assert.deepEqual(r.attrs[k], opts));
     if (wanted.v) assert.deepEqual(params.v, wanted.v);
     if (wanted.prev_defaults) assert.deepEqual(r.prev_defaults, wanted.prev_defaults);
     params.prev_defaults = r.prev_defaults;
 }
开发者ID:prigaux,项目名称:compte-externe,代码行数:10,代码来源:sub_and_defaults.spec.ts

示例6: exit

 cluster.on("exit", (_worker, code, _signal) => {
   if (code && code !== 0) {
     // Kill workers and exit if any worker dies
     _.forIn(cluster.workers, w => {
       if (w) {
         w.kill();
       }
     });
     exit(code);
   }
 });
开发者ID:nrkn,项目名称:quicktype,代码行数:11,代码来源:multicore.ts

示例7: save

  save() {
    const settings = {};
    _.forIn(this.settingsForm.controls, (control, key) => {
      if (!(control.value === '' || control.value === null)) {
        settings[key] = control.value;
      }
    });

    this.target_controls.setValue(settings);
    this.modalRef.hide();
  }
开发者ID:IlsooByun,项目名称:ceph,代码行数:11,代码来源:iscsi-target-iqn-settings-modal.component.ts

示例8: ngOnInit

  ngOnInit() {
    const fg = {};
    const currentSettings = this.imagesSettings[this.image];
    this.helpText = this.iscsiService.imageAdvancedSettings;

    _.forIn(this.disk_default_controls, (value, key) => {
      fg[key] = new FormControl(currentSettings[key]);
    });

    this.settingsForm = new CdFormGroup(fg);
  }
开发者ID:IlsooByun,项目名称:ceph,代码行数:11,代码来源:iscsi-target-image-settings-modal.component.ts

示例9: getRequestLookupExts

function getRequestLookupExts (requestType: RequestType): string[] {
  let exts: string[] = []

  _.forIn(LangTypes, (value, key) => {
    if (requestType === value.requestType) {
      exts.push(key)
    }
  })

  return exts
}
开发者ID:bbxyard,项目名称:bbxyard,代码行数:11,代码来源:resolveDep.ts

示例10: save

  save() {
    const settings = {};
    _.forIn(this.settingsForm.value, (value, key) => {
      if (!(value === '' || value === null)) {
        settings[key] = value;
      }
    });

    this.imagesSettings[this.image] = settings;
    this.imagesSettings = { ...this.imagesSettings };
    this.modalRef.hide();
  }
开发者ID:IlsooByun,项目名称:ceph,代码行数:12,代码来源:iscsi-target-image-settings-modal.component.ts


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