-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclean_comments.js
More file actions
30 lines (23 loc) · 1.03 KB
/
Copy pathclean_comments.js
File metadata and controls
30 lines (23 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const fs = require('fs');
const files = [
'frontend/src/pages/CheckIn.module.css',
'frontend/src/pages/Landing.jsx',
'frontend/src/pages/Landing.module.css',
'frontend/src/pages/Meditate.module.css'
];
files.forEach(file => {
let content = fs.readFileSync(file, 'utf8');
// Replace block decorations
// From:
// /* ═══════════════════════════════════════
// SOME HEADING
// ═══════════════════════════════════════ */
content = content.replace(/\/\* [═━─]+[\r\n]+\s*(.*?)\s*[\r\n]+\s*[═━─]+ \*\//g, '/* $1 */');
// Replace inline decorations
// From: /* ── Some heading ── */
content = content.replace(/\/\* [─━═]+ (.*?) [─━═]+ \*\//g, '/* $1 */');
// Replace other long borders
content = content.replace(/\/\* [━─═]+ \*\//g, '');
fs.writeFileSync(file, content, 'utf8');
});
console.log('Decorations cleaned');