本文整理汇总了TypeScript中faker.company类的典型用法代码示例。如果您正苦于以下问题:TypeScript company类的具体用法?TypeScript company怎么用?TypeScript company使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了company类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: createArray
const companies = createArray(50, i => {
return [
i,
faker.company.companyName(),
faker.company.bs(),
faker.phone.phoneNumber(),
faker.date.past(),
]
})
示例2: getRandomPerson
export function getRandomPerson(options: GetRandomPersonOptions) {
const opts: GetRandomPersonOptions = options || {};
opts.maxDateOfBirth = opts.maxDateOfBirth || new Date(Date.now() - MS_IN_YEAR);
opts.minAge = opts.minAge || 18;
opts.maxAge = opts.maxAge || 105;
opts.depth = opts.depth || 0;
// Generates a family tree...of sorts
const result: Person = {
name: faker.name.lastName() + faker.name.firstName(),
employment: {
companyName: faker.company.companyName()
},
regex: /a/g,
age: faker.random.number(),
dateOfBirth: faker.date.past(),
enrolledToVote: faker.random.boolean(),
};
if (opts.depth > 0) {
result.parents = [
getRandomPerson({ depth: opts.depth - 1 }),
getRandomPerson({ depth: opts.depth - 1 })
];
}
return result;
}
示例3: createFakeRowObjectData
createFakeRowObjectData(index: number): Object {
return {
id: index,
avartar: faker.image.avatar(),
city: faker.address.city(),
email: faker.internet.email(),
firstName: faker.name.firstName(),
lastName: faker.name.lastName(),
street: faker.address.streetName(),
zipCode: faker.address.zipCode(),
date: faker.date.past(),
bs: faker.company.bs(),
catchPhrase: faker.company.catchPhrase(),
companyName: faker.company.companyName(),
words: faker.lorem.words(),
sentence: faker.lorem.sentence(),
};
}
示例4:
id: 0,
title: "To Do",
cards: [
{ id: 1, title: faker.lorem.sentence() },
{ id: 2, title: faker.lorem.sentence() },
{ id: 3, title: faker.lorem.sentence() },
{ id: 4, title: faker.lorem.sentence() },
{ id: 5, title: "This card is a bigger than the other ones. "
+ faker.lorem.sentence() + " " + faker.lorem.sentence() }
]
},
{
id: 1,
title: "Doing",
cards: [
{ id: 6, title: faker.company.bs() },
{ id: 7, title: faker.company.bs() },
{ id: 8, title: faker.company.bs() },
{ id: 9, title: faker.company.bs() },
{ id: 10, title: faker.company.bs() }
]
},
{
id: 2,
title: "Done",
cards: [
{ id: 11, title: faker.name.jobTitle() },
{ id: 12, title: faker.name.jobTitle() },
{ id: 13, title: faker.name.jobTitle() },
{ id: 14, title: faker.name.jobTitle() },
{ id: 15, title: faker.name.jobTitle() }
示例6: shortBusinessName
public static shortBusinessName() {
return faker.company.companyName();
}