diff --git a/package.json b/package.json index 8fa5253..4208387 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "randomizer", "yugop" ], - "version": "2.2.3", + "version": "2.2.4", "license": "MIT", "module": "dist/use-scramble.esm.js", "main": "dist/index.js", diff --git a/src/index.ts b/src/index.ts index 7f723cc..0fe0c14 100644 --- a/src/index.ts +++ b/src/index.ts @@ -9,7 +9,7 @@ function getRandomChar(range: RangeOrCharCodes) { if (range.length === 2) { rand = getRandomInt(range[0], range[1] + 1); } else { - rand = range[getRandomInt(0, range.length - 1)]; + rand = range[getRandomInt(0, range.length)]; } return String.fromCharCode(rand);