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

docs: missing options jsdocs #2638

Merged
merged 3 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
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
19 changes: 19 additions & 0 deletions src/faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,8 +183,27 @@ export class Faker extends SimpleFaker {
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
*/
constructor(options: {
/**
* The locale data to use for this instance.
*
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
*/
locales: Record<string, LocaleDefinition>;
/**
* The name of the main locale to use.
*
* @default 'en'
*
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
*/
locale?: string;
/**
* The name of the fallback locale to use.
*
* @default 'en'
*
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
*/
localeFallback?: string;
});
// This is somehow required for `ConstructorParameters<typeof Faker>[0]` to work
Expand Down
15 changes: 15 additions & 0 deletions src/modules/finance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,23 @@ export class FinanceModule extends ModuleBase {
* @since 8.0.0
*/
maskedNumber(options?: {
/**
* The length of the unmasked number.
*
* @default 4
*/
length?: number;
/**
* Whether to use surrounding parenthesis.
*
* @default true
*/
parens?: boolean;
/**
* Whether to prefix the numbers with an ellipsis.
*
* @default true
*/
ellipsis?: boolean;
}): string;
/**
Expand Down
4 changes: 3 additions & 1 deletion src/modules/number/index.ts
ST-DDT marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class NumberModule extends SimpleModuleBase {
* The maximum number of digits to appear after the decimal point, for example `2` will round to 2 decimal points. Only one of `multipleOf`, `precision` or `fractionDigits` should be passed.
*/
fractionDigits?: number;
/*
/**
* Deprecated alias for `multipleOf`. Only one of `multipleOf`, `precision` or `fractionDigits` should be passed.
*
* @deprecated Use `multipleOf` instead.
Expand All @@ -156,7 +156,9 @@ export class NumberModule extends SimpleModuleBase {
min = 0,
max = 1,
fractionDigits,
// eslint-disable-next-line deprecation/deprecation
precision,
// eslint-disable-next-line deprecation/deprecation
multipleOf: originalMultipleOf = precision,
multipleOf = precision ??
(fractionDigits == null ? undefined : 10 ** -fractionDigits),
Expand Down
2 changes: 1 addition & 1 deletion src/simple-faker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export class SimpleFaker {
* // create a SimpleFaker without any locale data
* const customSimpleFaker = new SimpleFaker();
*
* customSimpleFaker.helpers.arrayElement([red', 'green', 'blue']); // 'green'
* customSimpleFaker.helpers.arrayElement(['red', 'green', 'blue']); // 'green'
* customSimpleFaker.number.int(10); // 4
*
* @since 8.1.0
Expand Down
Loading