|
@@ -115,11 +115,11 @@ function createSentence (minWords = DEFAULT_MIN_WORDS_PER_SENTENCE, maxWords = D
|
|
|
sentenceWords.push(
|
|
|
(i !== 0 && randomInt(0, 3) > 0)
|
|
|
? randomWord
|
|
|
- : randomWord.toUpperCase()
|
|
|
+ : randomWord[0].toUpperCase() + randomWord.slice(1)
|
|
|
);
|
|
|
}
|
|
|
|
|
|
- return sentenceWords.join(' ') + getRandomPunctuationMark;
|
|
|
+ return sentenceWords.join(' ') + getRandomPunctuationMark();
|
|
|
}
|
|
|
|
|
|
const Unit = {
|
|
@@ -134,7 +134,7 @@ const UnitFunction = {
|
|
|
|
|
|
function createText (num, unit = Unit.WORD) {
|
|
|
if (!UnitFunction.hasOwnProperty(unit)) {
|
|
|
- throw new Exception('Invalid unit parameter');
|
|
|
+ throw Error('Invalid unit parameter');
|
|
|
}
|
|
|
|
|
|
const unitCreator = UnitFunction[unit];
|