fix(tools): helper utils (#39603)
This commit is contained in:
committed by
GitHub
parent
3c223c2c7a
commit
aecbc28798
@ -29,8 +29,8 @@ if (!num) {
|
|||||||
num = parseInt(num, 10);
|
num = parseInt(num, 10);
|
||||||
const stepStart = parseInt(start, 10);
|
const stepStart = parseInt(start, 10);
|
||||||
|
|
||||||
if (num > 0 && num < 20) {
|
if (num < 1 || num > 20) {
|
||||||
throw `No steps created. num arg val must be greater than 1 and less than or equal to 20.`;
|
throw `No steps created. arg 'num' must be between 1 and 20 inclusive`;
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxStepNum = stepStart + num - 1;
|
const maxStepNum = stepStart + num - 1;
|
||||||
|
@ -5,12 +5,7 @@ const ObjectID = require('bson-objectid');
|
|||||||
|
|
||||||
const padWithLeadingZeros = originalNum => {
|
const padWithLeadingZeros = originalNum => {
|
||||||
/* always want file step numbers 3 digits */
|
/* always want file step numbers 3 digits */
|
||||||
const maxDigits = 3;
|
return ('' + originalNum).padStart(3, '0');
|
||||||
let paddedNum = '' + originalNum;
|
|
||||||
while (paddedNum.length < maxDigits) {
|
|
||||||
paddedNum = '0' + paddedNum;
|
|
||||||
}
|
|
||||||
return paddedNum;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeErms = seedCode => {
|
const removeErms = seedCode => {
|
||||||
|
Reference in New Issue
Block a user