From dc10a86cedcc4480be343d10e715120fb824e527 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sat, 3 Feb 2024 01:31:47 +0100 Subject: [PATCH 1/2] docs: missing options jsdocs --- src/faker.ts | 19 +++++++++++++++++++ src/modules/finance/index.ts | 15 +++++++++++++++ src/modules/number/index.ts | 4 +++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/src/faker.ts b/src/faker.ts index 97a513d052c..e63b89b3e59 100644 --- a/src/faker.ts +++ b/src/faker.ts @@ -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; + /** + * 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[0]` to work diff --git a/src/modules/finance/index.ts b/src/modules/finance/index.ts index 111db57101c..f7a84f7403e 100644 --- a/src/modules/finance/index.ts +++ b/src/modules/finance/index.ts @@ -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; /** diff --git a/src/modules/number/index.ts b/src/modules/number/index.ts index b4137ccebe5..9e9eb4edcd0 100644 --- a/src/modules/number/index.ts +++ b/src/modules/number/index.ts @@ -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. @@ -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), From b517839dc17d2e324ab6e15c010a573a7c54cc18 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Sun, 4 Feb 2024 01:07:06 +0100 Subject: [PATCH 2/2] chore: one more --- src/simple-faker.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simple-faker.ts b/src/simple-faker.ts index 4dd755e1cc7..3993392deab 100644 --- a/src/simple-faker.ts +++ b/src/simple-faker.ts @@ -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