本文整理匯總了TypeScript中ember-cli-mirage.faker.lorem.words方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript faker.lorem.words方法的具體用法?TypeScript faker.lorem.words怎麽用?TypeScript faker.lorem.words使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ember-cli-mirage.faker.lorem
的用法示例。
在下文中一共展示了faker.lorem.words方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: purgeNote
import { Factory, faker } from 'ember-cli-mirage';
import { PurgePolicy } from 'wherehows-web/constants';
import { hdfsUrn, nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
export default Factory.extend({
datasetId: null,
datasetUrn: faker.list.random(hdfsUrn, nonHdfsUrn),
purgeType: faker.list.random(...Object.values(PurgePolicy)),
purgeNote() {
const { purgeType } = this;
return purgeType === PurgePolicy.PurgeExempt ? faker.lorem.words(5) : '';
},
modifiedBy: faker.internet.userName(),
modifiedTime: faker.date.past()
});
示例2:
import { Factory, faker } from 'ember-cli-mirage';
import { DatasetPlatform, PurgePolicy } from 'wherehows-web/constants';
export default Factory.extend({
name: faker.list.random(...Object.values(DatasetPlatform)),
type: faker.lorem.words(1),
supportedPurgePolicies: Object.values(PurgePolicy)
});
示例3: dasherize
source: [...Array(10)].map(() => dasherize(faker.lorem.words().toLowerCase()))
示例4: uri
import { Factory, faker } from 'ember-cli-mirage';
import { DatasetPlatform } from 'wherehows-web/constants';
import { hdfsUrn, nonHdfsUrn } from 'wherehows-web/mirage/fixtures/urn';
export default Factory.extend({
createdTime: faker.date.past(2),
deprecated: true,
deprecationNote: faker.lorem.words(5),
description: faker.lorem.words(7),
fabric: null,
modifiedTime: faker.date.recent(),
nativeName: 'abook.default-public-container',
nativeType: null,
platform: faker.list.random(...Object.values(DatasetPlatform)),
properties: '{}',
removed: faker.random.boolean(),
tags: null,
uri() {
const { platform } = this;
return platform === DatasetPlatform.HDFS
? hdfsUrn
: nonHdfsUrn.replace(/li:dataPlatform:db/, `li:dataPlatform:${platform}`);
}
});