File size: 2,300 Bytes
ec3e1b1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { readFileSync, writeFileSync } from "fs";

const files = ["src/main.jsx", "style.css", "src/index.css"];

const replacements = [
  [/🪶/g, "🪶"], [/ðŸ"–/g, "📖"], [/🌻/g, "🌻"],
  [/ðŸ"š/g, "📚"], [/☕/g, "☕"], [/🕯️/g, "🕯️"],
  [/🕯ï¸/g, "🕯️"], [/🗝/g, "🗝"], [/ðŸ—/g, "🗝"],
  [/ðŸ"œ/g, "📜"], [/🎀/g, "🎀"], [/ðŸ¡/g, "🏡"],
  [/🏡/g, "🏡"], [/🐈/g, "🐈"], [/🍵/g, "🍵"],
  [/ðŸµ/g, "🍵"], [/ðŸ"»/g, "📻"], [/📻/g, "📻"],
  [/🗄/g, "🗄"], [/🗄️/g, "🗄"], [/🌱/g, "🌱"],
  [/🌿/g, "🌿"], [/🌸/g, "🌸"], [/🌳/g, "🌳"],
  [/😸/g, "😸"], [/📖/g, "📖"], [/📚/g, "📚"],
  [/📜/g, "📜"], [/📝/g, "📝"], [/👋/g, "👋"],
  [/👩/g, "👩"], [/📌/g, "📌"], [/🧭/g, "🧭"],
  [/🎟️/g, "🎟️"], [/💌/g, "💌"], [/📓/g, "📓"],
  [/🍚/g, "🍚"], [/🥣/g, "🥣"], [/🍪/g, "🍪"],
  [/📆/g, "🗓️"], [/🖼️/g, "🖼️"], [/📄/g, "📄"],
  [/🔗/g, "🔗"], [/🔥/g, "🔥"], [/🎹/g, "🎹"],
  [/🎧/g, "🎧"], [/🌲/g, "🌲"], [/🌧️/g, "🌧️"],
  [/🗓️/g, "🗓️"], [/📝/g, "📝"], [/📌/g, "📌"],
  [/🧭/g, "🧭"], [/👩/g, "👩"], [/🐈/g, "🐈"],
  [/🏡/g, "🏡"], [/🍵/g, "🍵"], [/📻/g, "📻"],
  [/“/g, "\""], [/”/g, "\""], [/â€/g, "\""],
  [/—/g, "-"], [/–/g, "-"],
  [/·/g, "·"], [/→/g, "→"], [/â†'/g, "→"],
  [/🗒️/g, "🗒️"], [/💡/g, "💡"], [/⭐/g, "⭐"],
  [/📷/g, "📷"], [/🧪/g, "🧪"], [/🌙/g, "🌙"],
];

for (const file of files) {
  try {
    let content = readFileSync(file, "utf8");
    if (content.charCodeAt(0) === 0xfeff) content = content.slice(1);
    for (const [from, to] of replacements) {
      content = content.replace(from, to);
    }
    writeFileSync(file, content, { encoding: "utf8" });
    console.log("Fixed:", file);
  } catch (error) {
    console.log("Skip:", file, error.message);
  }
}