Skip to content

Commit

Permalink
Use var in a small amount of newer code that used let, to match E…
Browse files Browse the repository at this point in the history
…S5 legacy support status of the rest of the module. We should probably decide on a strategy for moving this module to ES6, but there is no urgency.
  • Loading branch information
Tom Boutell committed Apr 1, 2020
1 parent 1125f4c commit cf7e1bb
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
package-lock.json
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 1.1.1

* Use `var` in a small amount of newer code that used `let`, to match ES5 legacy support status of the rest of the module. We should probably decide on a strategy for moving this module to ES6, but there is no urgency.

## 1.1.0

* Addition of `wordsPerString`, `separator` and `format` options. Thanks to Matteo Veraldi.
Expand Down
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -257,8 +257,8 @@ function words(options) {
}

function generateWordWithMaxLength() {
let rightSize = false;
let wordUsed;
var rightSize = false;
var wordUsed;
while (!rightSize) {
wordUsed = generateRandomWord();
if(wordUsed.length <= options.maxLength) {
Expand Down Expand Up @@ -337,4 +337,4 @@ function words(options) {

module.exports = words;
// Export the word list as it is often useful
words.wordList = wordList;
words.wordList = wordList;
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "random-words",
"version": "1.1.0",
"version": "1.1.1",
"description": "Generate one or more common English words",
"main": "index.js",
"scripts": {
Expand All @@ -20,5 +20,8 @@
"text"
],
"author": "Thomas Boutell",
"license": "MIT"
"license": "MIT",
"dependencies": {
"mocha": "^7.1.1"
}
}

0 comments on commit cf7e1bb

Please sign in to comment.