Skip to content

Commit

Permalink
chore: consistent jsdocs tag formatting (#2056)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT authored Apr 17, 2023
1 parent 153e0ca commit 62b1aed
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ import { mergeLocales } from './utils/merge-locales';
*
* faker.person.firstName(); // 'John'
* faker.person.lastName(); // 'Doe'
*
* @example
* import { Faker, es } from '@faker-js/faker';
* // const { Faker, es } = require('@faker-js/faker');
Expand Down Expand Up @@ -347,6 +346,7 @@ export class Faker {
* by logging the result and explicitly setting it if needed.
*
* @param seed The seed to use. Defaults to a random number.
*
* @returns The seed that was set.
*
* @see [Reproducible Results](https://next.fakerjs.dev/guide/usage.html#reproducible-results)
Expand Down Expand Up @@ -381,6 +381,7 @@ export class Faker {
* by logging the result and explicitly setting it if needed.
*
* @param seedArray The seed array to use.
*
* @returns The seed array that was set.
*
* @see [Reproducible Results](https://next.fakerjs.dev/guide/usage.html#reproducible-results)
Expand Down Expand Up @@ -415,6 +416,7 @@ export class Faker {
* by logging the result and explicitly setting it if needed.
*
* @param seed The seed or seed array to use.
*
* @returns The seed that was set.
*
* @see [Reproducible Results](https://next.fakerjs.dev/guide/usage.html#reproducible-results)
Expand Down
6 changes: 6 additions & 0 deletions src/modules/finance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -839,6 +839,7 @@ export class FinanceModule {
* Generates a random PIN number.
*
* @param length The length of the PIN to generate. Defaults to `4`.
*
* @throws Will throw an error if length is less than 1.
*
* @example
Expand All @@ -853,6 +854,7 @@ export class FinanceModule {
*
* @param options An options object. Defaults to `{}`.
* @param options.length The length of the PIN to generate. Defaults to `4`.
*
* @throws Will throw an error if length is less than 1.
*
* @example
Expand All @@ -874,6 +876,7 @@ export class FinanceModule {
*
* @param options An options object or the length of the PIN. Defaults to `{}`.
* @param options.length The length of the PIN to generate. Defaults to `4`.
*
* @throws Will throw an error if length is less than 1.
*
* @example
Expand All @@ -900,6 +903,7 @@ export class FinanceModule {
*
* @param options An options object or the length of the PIN. Defaults to `{}`.
* @param options.length The length of the PIN to generate. Defaults to `4`.
*
* @throws Will throw an error if length is less than 1.
*
* @example
Expand Down Expand Up @@ -957,6 +961,7 @@ export class FinanceModule {
*
* @param formatted Return a formatted version of the generated IBAN. Defaults to `false`.
* @param countryCode The country code from which you want to generate an IBAN, if none is provided a random country will be used.
*
* @throws Will throw an error if the passed country code is not supported.
*
* @example
Expand All @@ -973,6 +978,7 @@ export class FinanceModule {
* @param options An options object. Defaults to `{}`.
* @param options.formatted Return a formatted version of the generated IBAN. Defaults to `false`.
* @param options.countryCode The country code from which you want to generate an IBAN, if none is provided a random country will be used.
*
* @throws Will throw an error if the passed country code is not supported.
*
* @example
Expand Down
1 change: 0 additions & 1 deletion src/modules/git/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ export class GitModule {
* @param options.eol Choose the end of line character to use. Defaults to 'CRLF'.
* 'LF' = '\n',
* 'CRLF' = '\r\n'
*
* @param options.refDate The date to use as reference point for the commit. Defaults to `new Date()`.
*
* @example
Expand Down
13 changes: 13 additions & 0 deletions src/modules/helpers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,7 @@ export class HelpersModule {
* Takes an array and randomizes it in place then returns it.
*
* @template T The type of the elements to shuffle.
*
* @param list The array to shuffle.
* @param options The options to use when shuffling.
* @param options.inplace Whether to shuffle the array in place or return a new array. Defaults to `false`.
Expand All @@ -579,6 +580,7 @@ export class HelpersModule {
* Returns a randomized version of the array.
*
* @template T The type of the elements to shuffle.
*
* @param list The array to shuffle.
* @param options The options to use when shuffling.
* @param options.inplace Whether to shuffle the array in place or return a new array. Defaults to `false`.
Expand All @@ -604,6 +606,7 @@ export class HelpersModule {
* Returns a randomized version of the array.
*
* @template T The type of the elements to shuffle.
*
* @param list The array to shuffle.
* @param options The options to use when shuffling.
* @param options.inplace Whether to shuffle the array in place or return a new array. Defaults to `false`.
Expand Down Expand Up @@ -647,6 +650,7 @@ export class HelpersModule {
* This method does not store the unique state between invocations.
*
* @template T The type of the elements.
*
* @param source The strings to choose from or a function that generates a string.
* @param length The number of elements to generate.
*
Expand Down Expand Up @@ -721,6 +725,7 @@ export class HelpersModule {
* Returns the result of the callback if the probability check was successful, otherwise `undefined`.
*
* @template T The type of result of the given callback.
*
* @param callback The callback to that will be invoked if the probability check was successful.
* @param options The options to use. Defaults to `{}`.
* @param options.probability The probability (`[0.00, 1.00]`) of the callback being invoked. Defaults to `0.5`.
Expand Down Expand Up @@ -754,6 +759,7 @@ export class HelpersModule {
* Returns a random key from given object or `undefined` if no key could be found.
*
* @template T The type of the object to select from.
*
* @param object The object to be used.
*
* @example
Expand All @@ -770,6 +776,7 @@ export class HelpersModule {
* Returns a random value from given object or `undefined` if no key could be found.
*
* @template T The type of object to select from.
*
* @param object The object to be used.
*
* @example
Expand All @@ -786,6 +793,7 @@ export class HelpersModule {
* Returns random element from the given array.
*
* @template T The type of the elements to pick from.
*
* @param array Array to pick the value from.
*
* @example
Expand Down Expand Up @@ -813,6 +821,7 @@ export class HelpersModule {
* For example, if there are two values A and B, with weights 1 and 2 respectively, then the probability of picking A is 1/3 and the probability of picking B is 2/3.
*
* @template T The type of the elements to pick from.
*
* @param array Array to pick the value from.
* @param array[].weight The weight of the value.
* @param array[].value The value to pick.
Expand Down Expand Up @@ -868,6 +877,7 @@ export class HelpersModule {
* Returns a subset with random elements of the given array in random order.
*
* @template T The type of the elements to pick from.
*
* @param array Array to pick the value from.
* @param count Number or range of elements to pick.
* When not provided, random number of elements will be picked.
Expand Down Expand Up @@ -934,6 +944,7 @@ export class HelpersModule {
* This does the same as `objectValue` except that it ignores (the values assigned to) the numeric keys added for TypeScript enums.
*
* @template EnumType Type of generic enums, automatically inferred by TypeScript.
*
* @param enumObject Enum to pick the value from.
*
* @example
Expand Down Expand Up @@ -1228,6 +1239,7 @@ export class HelpersModule {
* Used unique entries will be stored internally and filtered from subsequent calls.
*
* @template Method The type of the method to execute.
*
* @param method The method used to generate the values.
* @param args The arguments used to call the method.
* @param options The optional options used to configure this method.
Expand Down Expand Up @@ -1327,6 +1339,7 @@ export class HelpersModule {
* Generates an array containing values returned by the given method.
*
* @template T The type of elements.
*
* @param method The method used to generate the values.
* @param options The optional options object.
* @param options.count The number or range of elements to generate. Defaults to `3`.
Expand Down
1 change: 1 addition & 0 deletions src/modules/helpers/unique.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ Try adjusting maxTime or maxRetries parameters for faker.helpers.unique().`
* Used unique entries will be stored internally and filtered from subsequent calls.
*
* @template Method The type of the method to execute.
*
* @param method The method used to generate the values.
* @param args The arguments used to call the method.
* @param options The optional options used to configure this method.
Expand Down
1 change: 1 addition & 0 deletions src/modules/person/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type SexType = `${Sex}`;
* @param param2.generic Non-sex definitions.
* @param param2.female Female definitions.
* @param param2.male Male definitions.
*
* @returns Definition based on given sex.
*/
function selectDefinition<T>(
Expand Down
1 change: 1 addition & 0 deletions src/modules/system/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ export class SystemModule {
* Returns a random file name with a given extension or a commonly used extension.
*
* @param ext Extension. Empty string is considered to be not set.
*
* @example
* faker.system.commonFileName() // 'dollar.jpg'
* faker.system.commonFileName('txt') // 'global_borders_wyoming.txt'
Expand Down
1 change: 1 addition & 0 deletions src/utils/merge-locales.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { LocaleDefinition } from '..';
* Mutating the category entries in the returned locale will also mutate the entries in the respective source locale.
*
* @param locales The locales to merge.
*
* @returns The newly merged locale.
*
* @example
Expand Down

0 comments on commit 62b1aed

Please sign in to comment.