preload.js 및 normalize_ko.js 파일 삭제, normalize.js 기능 개선 및 README 문서 업데이트

This commit is contained in:
2024-12-18 02:51:41 +09:00
parent 94059a0947
commit 2bd1c05af3
11 changed files with 94 additions and 2975 deletions

View File

@@ -50,11 +50,19 @@ function shouldIgnore(itemName) {
return ignoredItems.includes(itemName);
}
function normalizeToNFC(str) {
return str.normalize("NFC");
}
function normalizeToNFD(str) {
return str.normalize("NFD");
}
// Function to normalize file names
async function normalizeFileName(filePath) {
const dir = path.dirname(filePath);
const oldName = path.basename(filePath);
const newName = oldName.normalize("NFC");
const newName = convertToNFC(oldName);
if (oldName !== newName && !shouldIgnore(oldName)) {
const newPath = path.join(dir, newName);
@@ -118,6 +126,14 @@ const progressBar = new cliProgress.SingleBar(
cliProgress.Presets.shades_classic
);
module.exports = {
processPath,
shouldIgnore,
normalizeToNFC,
normalizeToNFD,
normalizeFileName,
};
// Handle input: if no flags, assume first non-flag argument is a path
const nonFlagArgs = args._;
if (nonFlagArgs.length > 0) {