Skip to content

Commit acba5b7

Browse files
authored
docs: missing options jsdocs (#2638)
1 parent acbdae7 commit acba5b7

File tree

4 files changed

+38
-2
lines changed

4 files changed

+38
-2
lines changed

src/faker.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,27 @@ export class Faker extends SimpleFaker {
183183
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
184184
*/
185185
constructor(options: {
186+
/**
187+
* The locale data to use for this instance.
188+
*
189+
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
190+
*/
186191
locales: Record<string, LocaleDefinition>;
192+
/**
193+
* The name of the main locale to use.
194+
*
195+
* @default 'en'
196+
*
197+
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
198+
*/
187199
locale?: string;
200+
/**
201+
* The name of the fallback locale to use.
202+
*
203+
* @default 'en'
204+
*
205+
* @deprecated Use `new Faker({ locale: [locale, localeFallback] })` instead.
206+
*/
188207
localeFallback?: string;
189208
});
190209
// This is somehow required for `ConstructorParameters<typeof Faker>[0]` to work

src/modules/finance/index.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,23 @@ export class FinanceModule extends ModuleBase {
271271
* @since 8.0.0
272272
*/
273273
maskedNumber(options?: {
274+
/**
275+
* The length of the unmasked number.
276+
*
277+
* @default 4
278+
*/
274279
length?: number;
280+
/**
281+
* Whether to use surrounding parenthesis.
282+
*
283+
* @default true
284+
*/
275285
parens?: boolean;
286+
/**
287+
* Whether to prefix the numbers with an ellipsis.
288+
*
289+
* @default true
290+
*/
276291
ellipsis?: boolean;
277292
}): string;
278293
/**

src/modules/number/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ export class NumberModule extends SimpleModuleBase {
134134
* 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.
135135
*/
136136
fractionDigits?: number;
137-
/*
137+
/**
138138
* Deprecated alias for `multipleOf`. Only one of `multipleOf`, `precision` or `fractionDigits` should be passed.
139139
*
140140
* @deprecated Use `multipleOf` instead.
@@ -156,7 +156,9 @@ export class NumberModule extends SimpleModuleBase {
156156
min = 0,
157157
max = 1,
158158
fractionDigits,
159+
// eslint-disable-next-line deprecation/deprecation
159160
precision,
161+
// eslint-disable-next-line deprecation/deprecation
160162
multipleOf: originalMultipleOf = precision,
161163
multipleOf = precision ??
162164
(fractionDigits == null ? undefined : 10 ** -fractionDigits),

src/simple-faker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ export class SimpleFaker {
105105
* // create a SimpleFaker without any locale data
106106
* const customSimpleFaker = new SimpleFaker();
107107
*
108-
* customSimpleFaker.helpers.arrayElement([red', 'green', 'blue']); // 'green'
108+
* customSimpleFaker.helpers.arrayElement(['red', 'green', 'blue']); // 'green'
109109
* customSimpleFaker.number.int(10); // 4
110110
*
111111
* @since 8.1.0

0 commit comments

Comments
 (0)