aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorST-DDT <[email protected]>2023-11-07 23:06:53 +0100
committerGitHub <[email protected]>2023-11-07 23:06:53 +0100
commit6f977f6b0122dc1761152d4eb7922fed63dc87c0 (patch)
tree2101c67a4a6b4ff3cbbcfdcdddf65e3f3695b4dd /src
parent6df70bce16500ab74a37f932f2e17a08f297430b (diff)
downloadfaker-6f977f6b0122dc1761152d4eb7922fed63dc87c0.tar.xz
faker-6f977f6b0122dc1761152d4eb7922fed63dc87c0.zip
refactor(string): remove arbitrary limit from sample (#2497)
Diffstat (limited to 'src')
-rw-r--r--src/modules/string/index.ts7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/modules/string/index.ts b/src/modules/string/index.ts
index 7c159a21..923c5286 100644
--- a/src/modules/string/index.ts
+++ b/src/modules/string/index.ts
@@ -79,8 +79,6 @@ export type NumericChar =
export type AlphaChar = LowerAlphaChar | UpperAlphaChar;
export type AlphaNumericChar = AlphaChar | NumericChar;
-const SAMPLE_MAX_LENGTH = 2 ** 20;
-
/**
* Module to generate string related entries.
*
@@ -621,7 +619,7 @@ export class StringModule extends SimpleModuleBase {
/**
* Returns a string containing UTF-16 chars between 33 and 125 (`!` to `}`).
*
- * @param length Length of the generated string. Max length is `2^20`. Defaults to `10`.
+ * @param length Length of the generated string. Defaults to `10`.
* @param length.min The minimum number of characters to generate.
* @param length.max The maximum number of characters to generate.
*
@@ -647,9 +645,6 @@ export class StringModule extends SimpleModuleBase {
} = 10
): string {
length = this.faker.helpers.rangeToNumber(length);
- if (length >= SAMPLE_MAX_LENGTH) {
- length = SAMPLE_MAX_LENGTH;
- }
const charCodeOption = {
min: 33,