Skip to content

Commit

Permalink
docs: missing options jsdocs (#2638)
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-DDT committed Feb 5, 2024
1 parent acbdae7 commit acba5b7
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 2 deletions.
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
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

0 comments on commit acba5b7

Please sign in to comment.