파일명 포맷에 접미사 기능 추가
This commit is contained in:
@@ -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() || '',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user