Skip to content

Commit

Permalink
docs: Fix 'Missing' entries (faker-js#565)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored and demipel8 committed Mar 11, 2022
1 parent 42547c0 commit 6526323
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ export class Helpers {
*
* Takes an array and returns a random element of the array.
*
* @template T The type of the entries to pick from.
* @param array The array to select an element from.
*
* @see faker.random.arrayElement()
Expand Down Expand Up @@ -396,6 +397,7 @@ export class Helpers {
*
* Uses the modern version of the Fisher–Yates algorithm.
*
* @template T The type of the entries to shuffle.
* @param o The array to shuffle. Defaults to `[]`.
*
* @example
Expand Down Expand Up @@ -423,13 +425,14 @@ export class Helpers {
* and outputs a unique array of strings based on that source.
* This method does not store the unique state between invocations.
*
* @template T The type of the entries.
* @param source The strings to choose from or a function that generates a string.
* @param length The number of elements to generate.
*
* @example
* uniqueArray(faker.random.word, 50)
* uniqueArray(faker.definitions.name.first_name, 6)
* uniqueArray(["Hello", "World", "Goodbye"], 2)
* faker.helpers.uniqueArray(faker.random.word, 50)
* faker.helpers.uniqueArray(faker.definitions.name.first_name, 6)
* faker.helpers.uniqueArray(["Hello", "World", "Goodbye"], 2)
*/
uniqueArray<T>(source: T[] | (() => T), length: number): T[] {
if (Array.isArray(source)) {
Expand Down
3 changes: 3 additions & 0 deletions src/vehicle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import type { Fake } from './fake';

let fake: Fake['fake'];

/**
* Module to generate vehicle related entries.
*/
export class Vehicle {
constructor(private readonly faker: Faker) {
fake = faker.fake;
Expand Down

0 comments on commit 6526323

Please sign in to comment.