파일명 포맷에 접미사 기능 추가

This commit is contained in:
2026-05-22 10:27:59 +09:00
parent 77bc2815a3
commit bb5fd0a0e9
5 changed files with 9 additions and 15 deletions
+2 -4
View File
@@ -9,14 +9,12 @@ export function clampDigits(value, fallback = 3) {
export function buildSequentialName(fileName, index, { prefix, digits, postfix = '' }) {
const ext = getExtension(fileName);
const sequence = `${prefix}_${String(index + 1).padStart(digits, '0')}`;
const suffix = postfix ? `_${postfix}` : '';
return `${sequence}${suffix}.${ext}`;
return `${prefix}${String(index + 1).padStart(digits, '0')}${postfix}.${ext}`;
}
export function getNameFormat(prefixInput, digitsInput, digitsFallback = 3, postfixInput = null) {
return {
prefix: prefixInput.value.trim() || 'photo',
prefix: prefixInput.value.trim() || 'photo_',
digits: clampDigits(digitsInput.value, digitsFallback),
postfix: postfixInput?.value.trim() || '',
};