Skip to content

Commit f7df49b

Browse files
feat: add script to extract unique categories from offlineStore.js content.
1 parent 96f6422 commit f7df49b

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/extractCats.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
const content = fs.readFileSync(path.join(__dirname, '../frontend/src/offlineStore.js'), 'utf8');
5+
const regex = /"category":\s*"([^"]+)"/g;
6+
let match;
7+
const categories = new Set();
8+
9+
while ((match = regex.exec(content)) !== null) {
10+
categories.add(match[1]);
11+
}
12+
13+
console.log('Unique Categories:', Array.from(categories).sort());

0 commit comments

Comments
 (0)