@@ -103,7 +103,7 @@ export class StringModule extends SimpleModuleBase {
103
103
*
104
104
* @param characters The characters to use for the string. Can be a string or an array of characters.
105
105
* If it is an array, then each element is treated as a single character even if it is a string with multiple characters.
106
- * @param length The length of the string to generate. Defaults to `1`.
106
+ * @param length The length of the string to generate either as a fixed length or as a length range . Defaults to `1`.
107
107
* @param length.min The minimum length of the string to generate.
108
108
* @param length.max The maximum length of the string to generate.
109
109
*
@@ -155,8 +155,8 @@ export class StringModule extends SimpleModuleBase {
155
155
/**
156
156
* Generating a string consisting of letters in the English alphabet.
157
157
*
158
- * @param options Either the number of characters or an options instance .
159
- * @param options.length The number or range of characters to generate. Defaults to `1`.
158
+ * @param options Either the length of the string to generate or the optional options object .
159
+ * @param options.length The length of the string to generate either as a fixed length or as a length range . Defaults to `1`.
160
160
* @param options.casing The casing of the characters. Defaults to `'mixed'`.
161
161
* @param options.exclude An array with characters which should be excluded in the generated string. Defaults to `[]`.
162
162
*
@@ -175,19 +175,19 @@ export class StringModule extends SimpleModuleBase {
175
175
| number
176
176
| {
177
177
/**
178
- * The number or range of characters to generate.
178
+ * The length of the string to generate either as a fixed length or as a length range .
179
179
*
180
180
* @default 1
181
181
*/
182
182
length ?:
183
183
| number
184
184
| {
185
185
/**
186
- * The minimum number of characters to generate.
186
+ * The minimum length of the string to generate.
187
187
*/
188
188
min : number ;
189
189
/**
190
- * The maximum number of characters to generate.
190
+ * The maximum length of the string to generate.
191
191
*/
192
192
max : number ;
193
193
} ;
@@ -249,8 +249,8 @@ export class StringModule extends SimpleModuleBase {
249
249
/**
250
250
* Generating a string consisting of alpha characters and digits.
251
251
*
252
- * @param options Either the number of characters or an options instance .
253
- * @param options.length The number or range of characters and digits to generate. Defaults to `1`.
252
+ * @param options Either the length of the string to generate or the optional options object .
253
+ * @param options.length The length of the string to generate either as a fixed length or as a length range . Defaults to `1`.
254
254
* @param options.casing The casing of the characters. Defaults to `'mixed'`.
255
255
* @param options.exclude An array of characters and digits which should be excluded in the generated string. Defaults to `[]`.
256
256
*
@@ -269,19 +269,19 @@ export class StringModule extends SimpleModuleBase {
269
269
| number
270
270
| {
271
271
/**
272
- * The number or range of characters and digits to generate.
272
+ * The length of the string to generate either as a fixed length or as a length range .
273
273
*
274
274
* @default 1
275
275
*/
276
276
length ?:
277
277
| number
278
278
| {
279
279
/**
280
- * The minimum number of characters and digits to generate.
280
+ * The minimum length of the string to generate.
281
281
*/
282
282
min : number ;
283
283
/**
284
- * The maximum number of characters and digits to generate.
284
+ * The maximum length of the string to generate.
285
285
*/
286
286
max : number ;
287
287
} ;
@@ -345,7 +345,7 @@ export class StringModule extends SimpleModuleBase {
345
345
* Returns a [binary](https://en.wikipedia.org/wiki/Binary_number) string.
346
346
*
347
347
* @param options The optional options object.
348
- * @param options.length The number or range of characters to generate after the prefix . Defaults to `1`.
348
+ * @param options.length The length of the string (excluding the prefix) to generate either as a fixed length or as a length range . Defaults to `1`.
349
349
* @param options.prefix Prefix for the generated number. Defaults to `'0b'`.
350
350
*
351
351
* @see faker.number.binary(): For generating a binary number (within a range).
@@ -362,19 +362,19 @@ export class StringModule extends SimpleModuleBase {
362
362
binary (
363
363
options : {
364
364
/**
365
- * The number or range of characters to generate after the prefix .
365
+ * The length of the string (excluding the prefix) to generate either as a fixed length or as a length range .
366
366
*
367
367
* @default 1
368
368
*/
369
369
length ?:
370
370
| number
371
371
| {
372
372
/**
373
- * The minimum number of characters to generate.
373
+ * The minimum length of the string (excluding the prefix) to generate.
374
374
*/
375
375
min : number ;
376
376
/**
377
- * The maximum number of characters to generate.
377
+ * The maximum length of the string (excluding the prefix) to generate.
378
378
*/
379
379
max : number ;
380
380
} ;
@@ -397,7 +397,7 @@ export class StringModule extends SimpleModuleBase {
397
397
* Returns an [octal](https://en.wikipedia.org/wiki/Octal) string.
398
398
*
399
399
* @param options The optional options object.
400
- * @param options.length The number or range of characters to generate after the prefix . Defaults to `1`.
400
+ * @param options.length The length of the string (excluding the prefix) to generate either as a fixed length or as a length range . Defaults to `1`.
401
401
* @param options.prefix Prefix for the generated number. Defaults to `'0o'`.
402
402
*
403
403
* @see faker.number.octal(): For generating an octal number (within a range).
@@ -414,19 +414,19 @@ export class StringModule extends SimpleModuleBase {
414
414
octal (
415
415
options : {
416
416
/**
417
- * The number or range of characters to generate after the prefix .
417
+ * The length of the string (excluding the prefix) to generate either as a fixed length or as a length range .
418
418
*
419
419
* @default 1
420
420
*/
421
421
length ?:
422
422
| number
423
423
| {
424
424
/**
425
- * The minimum number of characters to generate.
425
+ * The minimum length of the string (excluding the prefix) to generate.
426
426
*/
427
427
min : number ;
428
428
/**
429
- * The maximum number of characters to generate.
429
+ * The maximum length of the string (excluding the prefix) to generate.
430
430
*/
431
431
max : number ;
432
432
} ;
@@ -452,7 +452,7 @@ export class StringModule extends SimpleModuleBase {
452
452
* Returns a [hexadecimal](https://en.wikipedia.org/wiki/Hexadecimal) string.
453
453
*
454
454
* @param options The optional options object.
455
- * @param options.length The number or range of characters to generate after the prefix . Defaults to `1`.
455
+ * @param options.length The length of the string (excluding the prefix) to generate either as a fixed length or as a length range . Defaults to `1`.
456
456
* @param options.casing Casing of the generated number. Defaults to `'mixed'`.
457
457
* @param options.prefix Prefix for the generated number. Defaults to `'0x'`.
458
458
*
@@ -472,19 +472,19 @@ export class StringModule extends SimpleModuleBase {
472
472
hexadecimal (
473
473
options : {
474
474
/**
475
- * The number or range of characters to generate after the prefix .
475
+ * The length of the string (excluding the prefix) to generate either as a fixed length or as a length range .
476
476
*
477
477
* @default 1
478
478
*/
479
479
length ?:
480
480
| number
481
481
| {
482
482
/**
483
- * The minimum number of characters to generate after the prefix.
483
+ * The minimum length of the string (excluding the prefix) to generate .
484
484
*/
485
485
min : number ;
486
486
/**
487
- * The maximum number of characters to generate after the prefix.
487
+ * The maximum length of the string (excluding the prefix) to generate .
488
488
*/
489
489
max : number ;
490
490
} ;
@@ -548,8 +548,8 @@ export class StringModule extends SimpleModuleBase {
548
548
/**
549
549
* Generates a given length string of digits.
550
550
*
551
- * @param options Either the number of characters or the options to use .
552
- * @param options.length The number or range of digits to generate. Defaults to `1`.
551
+ * @param options Either the length of the string to generate or the optional options object .
552
+ * @param options.length The length of the string to generate either as a fixed length or as a length range . Defaults to `1`.
553
553
* @param options.allowLeadingZeros Whether leading zeros are allowed or not. Defaults to `true`.
554
554
* @param options.exclude An array of digits which should be excluded in the generated string. Defaults to `[]`.
555
555
*
@@ -570,19 +570,19 @@ export class StringModule extends SimpleModuleBase {
570
570
| number
571
571
| {
572
572
/**
573
- * The number or range of digits to generate.
573
+ * The length of the string to generate either as a fixed length or as a length range .
574
574
*
575
575
* @default 1
576
576
*/
577
577
length ?:
578
578
| number
579
579
| {
580
580
/**
581
- * The minimum number of digits to generate.
581
+ * The minimum length of the string to generate.
582
582
*/
583
583
min : number ;
584
584
/**
585
- * The maximum number of digits to generate.
585
+ * The maximum length of the string to generate.
586
586
*/
587
587
max : number ;
588
588
} ;
@@ -649,9 +649,9 @@ export class StringModule extends SimpleModuleBase {
649
649
/**
650
650
* Returns a string containing UTF-16 chars between 33 and 125 (`!` to `}`).
651
651
*
652
- * @param length Length of the generated string. Defaults to `10`.
653
- * @param length.min The minimum number of characters to generate.
654
- * @param length.max The maximum number of characters to generate.
652
+ * @param length The length of the string (excluding the prefix) to generate either as a fixed length or as a length range . Defaults to `10`.
653
+ * @param length.min The minimum length of the string to generate.
654
+ * @param length.max The maximum length of the string to generate.
655
655
*
656
656
* @example
657
657
* faker.string.sample() // 'Zo!.:*e>wR'
@@ -665,11 +665,11 @@ export class StringModule extends SimpleModuleBase {
665
665
| number
666
666
| {
667
667
/**
668
- * The minimum number of characters to generate.
668
+ * The minimum length of the string to generate.
669
669
*/
670
670
min : number ;
671
671
/**
672
- * The maximum number of characters to generate.
672
+ * The maximum length of the string to generate.
673
673
*/
674
674
max : number ;
675
675
} = 10
@@ -740,7 +740,7 @@ export class StringModule extends SimpleModuleBase {
740
740
/**
741
741
* Generates a [Nano ID](https://github.com/ai/nanoid).
742
742
*
743
- * @param length Length of the generated string. Defaults to `21`.
743
+ * @param length The length of the string to generate either as a fixed length or as a length range . Defaults to `21`.
744
744
* @param length.min The minimum length of the Nano ID to generate.
745
745
* @param length.max The maximum length of the Nano ID to generate.
746
746
*
@@ -794,13 +794,14 @@ export class StringModule extends SimpleModuleBase {
794
794
795
795
/**
796
796
* Returns a string containing only special characters from the following list:
797
+ *
797
798
* ```txt
798
799
* ! " # $ % & ' ( ) * + , - . / : ; < = > ? @ [ \ ] ^ _ ` { | } ~
799
800
* ```
800
801
*
801
- * @param length Length of the generated string. Defaults to `1`.
802
- * @param length.min The minimum number of special characters to generate.
803
- * @param length.max The maximum number of special characters to generate.
802
+ * @param length The length of the string to generate either as a fixed length or as a length range . Defaults to `1`.
803
+ * @param length.min The minimum length of the string to generate.
804
+ * @param length.max The maximum length of the string to generate.
804
805
*
805
806
* @example
806
807
* faker.string.symbol() // '$'
@@ -814,11 +815,11 @@ export class StringModule extends SimpleModuleBase {
814
815
| number
815
816
| {
816
817
/**
817
- * The minimum number of special characters to generate.
818
+ * The minimum length of the string to generate.
818
819
*/
819
820
min : number ;
820
821
/**
821
- * The maximum number of special characters to generate.
822
+ * The maximum length of the string to generate.
822
823
*/
823
824
max : number ;
824
825
} = 1
0 commit comments