Skip to content

docs(string): update function jsdocs #1473

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 1 commit into from
Oct 20, 2022
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
14 changes: 9 additions & 5 deletions src/modules/string/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,16 @@ export class StringModule {
/**
* Generating a string consisting of letters in the English alphabet.
*
* @param options Either the number of characters or an options instance. Defaults to `{ length: 1, casing: 'lower', bannedChars: [] }`.
* @param options Either the number of characters or an options instance. Defaults to `{ length: 1, casing: 'mixed', bannedChars: [] }`.
* @param options.length The number of characters to generate. Defaults to `1`.
* @param options.casing The casing of the characters. Defaults to `'lower'`.
* @param options.casing The casing of the characters. Defaults to `'mixed'`.
* @param options.bannedChars An array with characters to exclude. Defaults to `[]`.
*
* @example
* faker.string.alpha() // 'b'
* faker.string.alpha(10) // 'qccrabobaf'
* faker.string.alpha(10) // 'fEcAaCVbaR'
* faker.string.alpha({ casing: 'lower' }) // 'r'
* faker.string.alpha({ bannedChars: ['W'] }) // 'Z'
* faker.string.alpha({ length: 5, casing: 'upper', bannedChars: ['A'] }) // 'DTCIC'
*
* @since 8.0.0
Expand Down Expand Up @@ -173,8 +175,10 @@ export class StringModule {
*
* @example
* faker.string.alphanumeric() // '2'
* faker.string.alphanumeric(5) // '3e5v7'
* faker.string.alphanumeric({ length: 5, bannedChars: ["a"] }) // 'xszlm'
* faker.string.alphanumeric(5) // '3e5V7'
* faker.string.alphanumeric({ casing: 'upper' }) // 'A'
* faker.string.alphanumeric({ bannedChars: ['W'] }) // 'r'
* faker.string.alphanumeric({ length: 5, bannedChars: ["a"] }) // 'x1Z7f'
*
* @since 8.0.0
*/
Expand Down