當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。