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


TypeScript name.findName方法代码示例

本文整理汇总了TypeScript中faker.name.findName方法的典型用法代码示例。如果您正苦于以下问题:TypeScript name.findName方法的具体用法?TypeScript name.findName怎么用?TypeScript name.findName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在faker.name的用法示例。


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

示例1: times

 data: times(3, (index) => {
     return {
         'id' : index + +offset + 1,
         'firstname': faker.name.findName().split(' ')[0],
         'lastname': faker.name.findName().split(' ')[0],
         'email': faker.internet.email()
     };
 })
开发者ID:syafiqrokman,项目名称:angular5-iot-dashboard,代码行数:8,代码来源:mocks.service.ts

示例2: createItem

function createItem() {
  return {
    name: faker.name.findName(),
    phone: faker.phone.phoneNumber(),
    country: faker.address.country()
  };
}
开发者ID:aurelia,项目名称:aurelia,代码行数:7,代码来源:app.ts

示例3: createArray

 const persons = createArray(numberOfPersons, i => {
     return [
         i,
         faker.name.findName(),
         faker.address.streetAddress(),
         faker.phone.phoneNumber(),
         faker.date.past(),
     ]
 })
开发者ID:jakobrun,项目名称:gandalf,代码行数:9,代码来源:generatePgData.ts

示例4: switch

function getSanitizedValue<D>(
  defaultValue: D,
  sanitizeConfig?: SanitizeConfig
) {
  if (!sanitizeConfig) return defaultValue;
  switch (sanitizeConfig) {
    case 'name':
      return faker.name.findName();
    case 'email':
      return faker.internet.email();
    case 'lorem':
      return faker.lorem.sentences();
    default:
      return faker.lorem.text();
  }
}
开发者ID:tyranid-org,项目名称:tyranid,代码行数:16,代码来源:sanitize.ts

示例5: getFakerData

 /**
  * Use faker to generate metadata for the inputs
  * @param {type} 
  * the type of input to generate metadata for
  */
 getFakerData(type): any {
     switch (type) {
         case 'string':
             return faker.lorem.sentence();
         case 'boolean':
             return Math.random() > 0.5;
         case 'sentence':
             return faker.lorem.sentence();
         case 'image':
             let width = Math.floor(Math.random() * (500 - 300 + 1) + 300);
             let height = Math.floor(Math.random() * (300 - 250 + 1) + 300);
             return faker.image.imageUrl(width, height);
         case 'avatar':
             return faker.image.avatar();
         case 'words':
             return faker.lorem.words();
         case 'phone':
             return faker.phone.phoneNumber();
         case 'name':
             return faker.name.findName();
         default:
             return null;
     }
 }
开发者ID:joaogarin,项目名称:carte-blanche-angular2,代码行数:29,代码来源:fakerDataGenerator.service.ts

示例6:

  filter: string;
  order: TNGOR_SORT;
  sort: 'id' | 'name' | 'birthdate';
}

interface IUserDto {
  id: number;
  name: string;
  birthdate: string;
}

const users: IUserDto[] = [
  {
    birthdate: faker.date.past().toISOString(),
    id: 1,
    name: faker.name.findName(),
  },
  {
    birthdate: faker.date.past().toISOString(),
    id: 2,
    name: faker.name.findName(),
  },
  {
    birthdate: faker.date.past().toISOString(),
    id: 3,
    name: faker.name.findName(),
  },
  {
    birthdate: faker.date.past().toISOString(),
    id: 4,
    name: faker.name.findName(),
开发者ID:santech-org,项目名称:ng-on-rest,代码行数:31,代码来源:datagrid.component.spec.ts

示例7:

 fullName: () => faker.name.findName(),
开发者ID:codeaudit,项目名称:graphql-faker,代码行数:1,代码来源:fake.ts

示例8: moment

import * as moment from 'moment-mini-ts';
import * as faker from 'faker';

export interface CalendarState {
  events: List<CalendarEvent>;
  startDate: moment.Moment,
  inFlight: CalendarEvent | null;
  original: CalendarEvent | null;
  diff: Diff;
}

const dayOne = moment().startOf('month');

export const CalendarStateRecord = Record({
  events: List([
    CalendarEvent.standard(`Meeting with ${faker.name.findName()}`, dayOne.clone().add({ days: 3, hours: 13 }).toDate()),
    CalendarEvent.allDay("Conference in Berlin", dayOne.clone().add({ days: 7 }).toDate(), dayOne.clone().add({ days: 11 }).toDate()),
  ]),
  startDate: dayOne,
  inFlight: null as CalendarEvent,
  original: null as CalendarEvent,
  diff: new Diff()
});

export function reducer(state = new CalendarStateRecord(), action: CalendarActions): CalendarState {
  // console.log(action);
  switch (action.type) {

    case CalendarActionTypes.NewEvent: {
      return state.update('events', es => es.push(action.event));
    }
开发者ID:fossabot,项目名称:angular-skyhook,代码行数:31,代码来源:calendar.reducer.ts


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