Skip to content

Commit

Permalink
Merge pull request #1 from envkey/require-static
Browse files Browse the repository at this point in the history
Modify the small vs big dictionary require statement
  • Loading branch information
ruffrey authored Sep 15, 2020
2 parents 92c17c7 + 7232bb7 commit c78844c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
4 changes: 1 addition & 3 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
tsconfig.json
CHANGELOG.md
dist/test.*
src/
dist/test.*
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"scripts": {
"watch-build": "npm run build -- -w",
"build": "tsc -p ./",
"test": "node dist/test"
"test": "node dist/test",
"preinstall": "npm run build"
},
"repository": {
"type": "git",
Expand Down Expand Up @@ -39,5 +40,6 @@
"devDependencies": {
"@types/node": "^11.13.7",
"typescript": "^3.4.5"
}
},
"dependencies": {}
}
8 changes: 5 additions & 3 deletions src/rword.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,11 @@ export class rword {
* Load and shuffle word list
*/
static load(list: 'big' | 'small') {
words = JSON.parse(
readFileSync(resolve(__dirname, `../words/${list}.json`), 'utf8')
);
if (list === 'small') {
words = require('../words/small.json');
} else {
words = require('../words/big.json');
}
rword.shuffle();
}
}
Expand Down

1 comment on commit c78844c

@NikolaNemessisNewAge
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copyright 2017 Xyfir, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.Copyright 2017 Xyfir, LLC

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Please sign in to comment.