Skip to content

Commit

Permalink
chore(helpers): fix examples on internal functions (#2559)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Dec 1, 2023
1 parent 2eca5bc commit 9dd57d7
Showing 1 changed file with 13 additions and 11 deletions.
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

0 comments on commit 9dd57d7

Please sign in to comment.