17 lines
432 B
TypeScript
17 lines
432 B
TypeScript
import path from "path";
|
|
|
|
export default function (file: Express.Multer.File) {
|
|
return `${path.parse(path.basename(file.originalname)).name}-${Math.floor(
|
|
Date.now() / 1000
|
|
)}${path.extname(file.originalname)}`;
|
|
}
|
|
|
|
export function generateUniqueBillFilename(
|
|
file: Express.Multer.File,
|
|
invoice_number: string
|
|
) {
|
|
return `${invoice_number}-${Math.floor(Date.now() / 1000)}${path.extname(
|
|
file.originalname
|
|
)}`;
|
|
}
|