@jrrembert/luhnjs 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/luhn.js +2 -2
- package/package.json +1 -1
package/dist/src/luhn.js
CHANGED
|
@@ -100,10 +100,10 @@ function random(length) {
|
|
|
100
100
|
handleErrors(length);
|
|
101
101
|
const lengthAsInteger = parseInt(length);
|
|
102
102
|
if (lengthAsInteger > 100) {
|
|
103
|
-
throw new Error('
|
|
103
|
+
throw new Error('length must be less than or equal to 100');
|
|
104
104
|
}
|
|
105
105
|
if (lengthAsInteger < 2) {
|
|
106
|
-
throw new Error('
|
|
106
|
+
throw new Error('length must be greater than or equal to 2');
|
|
107
107
|
}
|
|
108
108
|
const random = Array.from({ length: lengthAsInteger - 1 }, (_, index) => {
|
|
109
109
|
// Ensure the first digit is not zero
|