twl-generator 1.1.4 → 1.1.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twl-generator",
3
- "version": "1.1.4",
3
+ "version": "1.1.5",
4
4
  "description": "Generate term-to-article lists from unfoldingWord en_tw archive for Bible books. Works in both Node.js (CLI) and React.js (browser) environments.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -57,4 +57,4 @@
57
57
  "optional": true
58
58
  }
59
59
  }
60
- }
60
+ }
@@ -282,14 +282,14 @@ function findMatches(verseText, termTrie) {
282
282
  }
283
283
 
284
284
  /**
285
- * Generate a 4-character hex ID starting with a letter
285
+ * Generate a 4-character ID starting with a letter
286
286
  */
287
287
  function generateId() {
288
- const letters = 'abcdef';
289
- const hex = '0123456789abcdef';
288
+ const letters = 'abcdefghijklmnopqrstuvwxyz';
289
+ const lettersAndDigits = 'abcdefghijklmnopqrstuvwxyz0123456789';
290
290
  let id = letters[Math.floor(Math.random() * letters.length)];
291
291
  for (let i = 0; i < 3; i++) {
292
- id += hex[Math.floor(Math.random() * hex.length)];
292
+ id += lettersAndDigits[Math.floor(Math.random() * lettersAndDigits.length)];
293
293
  }
294
294
  return id;
295
295
  }