venus-pit 1.1.5 → 1.1.6
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/LICENSE +373 -661
- package/dist/venus.bundle.js +2 -2
- package/dist/venus.bundle.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/tarpit/markov.js +1 -1
- package/src/lib/tarpit/words/randomWord.js +1 -1
- package/testing/venus.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "venus-pit",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.6",
|
|
4
4
|
"description": "Express.js-based tarpit",
|
|
5
5
|
"main": "dist/venus.bundle.js",
|
|
6
6
|
"type": "module",
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"devbuild": "npm run build && cp dist/venus.bundle.js testing/venus.js"
|
|
15
15
|
},
|
|
16
16
|
"author": "Shrey Yadav",
|
|
17
|
-
"license": "
|
|
17
|
+
"license": "MPL-2.0",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"express": "^5.1.0"
|
|
20
20
|
},
|
package/src/lib/tarpit/markov.js
CHANGED
|
@@ -2,7 +2,7 @@ import corpora from "../corpora.js"
|
|
|
2
2
|
import crypto from 'crypto'
|
|
3
3
|
|
|
4
4
|
// remove all non a-z, lowercase, split into tokens
|
|
5
|
-
let wordList = corpora.replace(/[^a-zA-Z ]/g, "").toLowerCase().split(
|
|
5
|
+
let wordList = corpora.replace(/[^a-zA-Z ]/g, "").toLowerCase().split(/\s+/); // more efficient to just compute once
|
|
6
6
|
function randomWord() {
|
|
7
7
|
const index = crypto.randomInt(0, wordList.length);
|
|
8
8
|
return wordList[index];
|