Skip to content

docs: Fix 'Missing' entries #565

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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