Skip to content
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

chore(helpers): fix examples on internal functions #2559

Merged
merged 3 commits into from
Dec 1, 2023
Merged
Changes from all commits
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
24 changes: 13 additions & 11 deletions src/modules/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,17 @@ import * as uniqueExec from './unique';
/**
* Returns a number based on given RegEx-based quantifier symbol or quantifier values.
*
* @param faker Faker instance
* @param faker The Faker instance to use.
* @param quantifierSymbol Quantifier symbols can be either of these: `?`, `*`, `+`.
* @param quantifierMin Quantifier minimum value. If given without a maximum, this will be used as the quantifier value.
* @param quantifierMax Quantifier maximum value. Will randomly get a value between the minimum and maximum if both are provided.
*
* @returns a random number based on the given quantifier parameters.
*
* @example
* getRepetitionsBasedOnQuantifierParameters(this.faker, '*', null, null) // 3
* getRepetitionsBasedOnQuantifierParameters(this.faker, null, 10, null) // 10
* getRepetitionsBasedOnQuantifierParameters(this.faker, null, 5, 8) // 6
* getRepetitionsBasedOnQuantifierParameters(faker, '*', null, null) // 3
* getRepetitionsBasedOnQuantifierParameters(faker, null, 10, null) // 10
* getRepetitionsBasedOnQuantifierParameters(faker, null, 5, 8) // 6
*
* @since 8.0.0
*/
Expand Down Expand Up @@ -73,7 +73,9 @@ function getRepetitionsBasedOnQuantifierParameters(
}

/**
* Replaces the regex like expressions in the given string with matching values. Note: This method will be removed in v9.
* Replaces the regex like expressions in the given string with matching values.
*
* Note: This method will be removed in v9.
*
* Supported patterns:
* - `.{times}` => Repeat the character exactly `times` times.
Expand All @@ -82,15 +84,15 @@ function getRepetitionsBasedOnQuantifierParameters(
*
* @internal
*
* @param faker A Faker instance.
* @param faker The Faker instance to use.
* @param string The template string to parse.
*
* @example
* faker.helpers.legacyRegexpStringParse() // ''
* faker.helpers.legacyRegexpStringParse('#{5}') // '#####'
* faker.helpers.legacyRegexpStringParse('#{2,9}') // '#######'
* faker.helpers.legacyRegexpStringParse('[500-15000]') // '8375'
* faker.helpers.legacyRegexpStringParse('#{3}test[1-5]') // '###test3'
* legacyRegexpStringParse(faker) // ''
* legacyRegexpStringParse(faker, '#{5}') // '#####'
* legacyRegexpStringParse(faker, '#{2,9}') // '#######'
* legacyRegexpStringParse(faker, '[500-15000]') // '8375'
* legacyRegexpStringParse(faker, '#{3}test[1-5]') // '###test3'
*
* @since 5.0.0
*/
Expand Down