mirror of
https://github.com/ragestudio/comty.git
synced 2025-06-10 02:54:15 +00:00
use random id to generate id
This commit is contained in:
parent
685af011c1
commit
494fbc707d
@ -1,5 +1,6 @@
|
||||
import path from "path"
|
||||
import fs from "fs"
|
||||
import { nanoid } from 'nanoid'
|
||||
|
||||
import pmap from "../../../utils/pMap"
|
||||
|
||||
@ -41,9 +42,7 @@ export default async (payload) => {
|
||||
maxFileSize: params.maxFileSize,
|
||||
maxFields: params.maxFields,
|
||||
filename: (name, ext) => {
|
||||
name = name.trim()
|
||||
name = name.replace(/ /g, "_")
|
||||
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "")
|
||||
name = nanoid()
|
||||
|
||||
return name + ext
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user