TikTok V4
This commit is contained in:
20
tmp-cleanup.js
Normal file
20
tmp-cleanup.js
Normal file
@@ -0,0 +1,20 @@
|
||||
const fs = require('fs');
|
||||
const file = 'src/lib/growth-pages.ts';
|
||||
let content = fs.readFileSync(file, 'utf8');
|
||||
|
||||
// The file has two sections: allUseCases and useCasePageContent
|
||||
// They might both be duplicated.
|
||||
function removeSecond(text, regexStr) {
|
||||
const regex = new RegExp(regexStr, 'g');
|
||||
let match;
|
||||
let count = 0;
|
||||
let indices = [];
|
||||
while ((match = regex.exec(text)) !== null) {
|
||||
indices.push(match.index);
|
||||
}
|
||||
if (indices.length > 1) {
|
||||
console.log("Found " + indices.length + " instances of " + regexStr + ", removing from second instance");
|
||||
// We will remove from the second instance to the end of the object
|
||||
// This is tricky for nested objects.
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user