當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript lodash.toPlainObject函數代碼示例

本文整理匯總了TypeScript中lodash.toPlainObject函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript toPlainObject函數的具體用法?TypeScript toPlainObject怎麽用?TypeScript toPlainObject使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了toPlainObject函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1:

 const removePrototype = (srcVal: any, objVal: any) => {
     if (ng1.isObject(objVal) && !ng1.isArray(objVal)) {
         return _.toPlainObject(objVal);
     } else {
         return objVal;
     }
 };
開發者ID:QuBaR,項目名稱:ng-table,代碼行數:7,代碼來源:jasmine-extensions.ts

示例2: test

   test('with NUMERIC internal id', function () {

      const c = new cust.CustomerBase(123)

      expect(c).toBeTruthy()
      // should call load once
      expect(mockrecord.load.mock.calls.length).toBe(1)
      console.log(_.toPlainObject(c))
   })
開發者ID:ExploreConsulting,項目名稱:netsuite-fasttrack-toolkit-ss2,代碼行數:9,代碼來源:nsdal.test.ts

示例3: UserRegistration

                    .then(() => {
                        const fixture = TestBed.createComponent(TestComponent);
                        fixture.detectChanges();

                        const component: UserRegistrationComponent =
                            fixture.debugElement.children[0].componentInstance as UserRegistrationComponent;

                        const dom: HTMLElement = fixture.debugElement.children[0].nativeElement as HTMLElement;

                        const formData: UserRegistration = new UserRegistration(
                            'Lazar',
                            'Bodor',
                            'Geoscience Australia',
                            'Software developer',
                            'lazar.bodor@ga.gov.au',
                            '0451061798',
                            'ADE1',
                        );

                        const setValue = (value: string, controlName: string): void => {
                            let input: HTMLInputElement =
                                dom.querySelector('text-input[controlname=' + controlName + '] input') as HTMLInputElement;

                            if (!input) {
                                input = dom.querySelector('email-input[controlname='
                                    + controlName + '] input') as HTMLInputElement;
                            }
                            if (!input) {
                                input = dom.querySelector('textarea-input[controlname='
                                    + controlName + '] textarea') as HTMLInputElement;
                            }
                            expect(input).toBeTruthy();

                            input.value = value;
                            input.dispatchEvent(new Event('input'));
                        };

                        _.forOwn(formData, setValue);

                        fixture.detectChanges();
                        component.submit();

                        expect(_.isEqual(_.toPlainObject(mockUserService.registration), _.toPlainObject(formData))).toBeTruthy();
                    });
開發者ID:GeoscienceAustralia,項目名稱:gnss-site-manager,代碼行數:44,代碼來源:user-registration.component.spec.ts

示例4: handler

 return handler(arg).catch(e => {
   throw _.toPlainObject(e);
 });
開發者ID:wonderful-panda,項目名稱:inazuma,代碼行數:3,代碼來源:actions.ts


注:本文中的lodash.toPlainObject函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。