MCPcopy
hub / github.com/faker-js/faker / text

Method text

src/modules/lorem/index.ts:322–334  ·  view source on GitHub ↗

* Generates a random text based on a random lorem method. * * @example * faker.lorem.text() // 'Doloribus autem non quis vero quia.' * faker.lorem.text() * // 'Rerum eum reiciendis id ipsa hic dolore aut laborum provident. * // Quis beatae quis corporis veritatis corrupti ratione d

()

Source from the content-addressed store, hash-verified

320 * @since 3.1.0
321 */
322 text(): string {
323 const methods: Array<keyof LoremModule> = [
324 'sentence',
325 'sentences',
326 'paragraph',
327 'paragraphs',
328 'lines',
329 ];
330
331 const method = this.faker.helpers.arrayElement(methods);
332
333 return this[method]();
334 }
335
336 /**
337 * Generates the given number lines of lorem separated by `'\n'`.

Callers 3

lorem.spec.tsFile · 0.80
api.cy.tsFile · 0.80

Calls 1

arrayElementMethod · 0.80

Tested by

no test coverage detected