mirror of
https://github.com/jung-geun/NFD2NFC.git
synced 2025-12-20 04:20:45 +09:00
preload.js 및 normalize_ko.js 파일 삭제, normalize.js 기능 개선 및 README 문서 업데이트
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user