twl-generator 1.2.13 → 1.2.15

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/README.md CHANGED
@@ -69,7 +69,7 @@ const usfmContent = `
69
69
  \\v 1 In the beginning...
70
70
  `;
71
71
 
72
- const book = 'mat'; // Book code (optional if USFM contains book info)
72
+ const book = 'mat';
73
73
 
74
74
  const tsv = await generateTWLWithUsfm(book, usfmContent);
75
75
  // tsv is a string in TSV format, ready to save or process
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twl-generator",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
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": {
@@ -4,7 +4,7 @@
4
4
  function generateVariants(term, isName = false) {
5
5
  const variants = new Set([term]);
6
6
 
7
- const isNoun = ['horn', 'mare', 'steed', 'horse', 'doe', 'deer', 'father', 'Father'].includes(term) || isName;
7
+ const isNoun = ['horn', 'mare', 'steed', 'horse', 'doe', 'deer', 'father', 'Father', 'cross', 'well'].includes(term) || isName;
8
8
  const doNotPluralize = ['doe'].includes(term);
9
9
  const doNotDepluralize = ['kids'].includes(term) || isName;
10
10
 
@@ -27,7 +27,13 @@ async function getCachedZip() {
27
27
  const cached = localStorage.getItem(CACHE_KEY);
28
28
  if (cached) {
29
29
  const data = JSON.parse(cached);
30
- if (data.version === CACHE_VERSION) {
30
+ // Only use cache if version matches and cache is less than 5 minutes old
31
+ const FIVE_MINUTES = 5 * 60 * 1000;
32
+ if (
33
+ data.version === CACHE_VERSION &&
34
+ data.timestamp &&
35
+ (Date.now() - data.timestamp) < FIVE_MINUTES
36
+ ) {
31
37
  console.log('Using cached ZIP from browser storage');
32
38
  return new Uint8Array(data.zipData);
33
39
  } else {