Spaces:
Running
Running
| 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); | |
| } | |
| } | |