export const isCheckAccept = (fileType: string, accept?: string): boolean => { if (!accept) return true const item = fileType.split('/').at(0)?.toLowerCase() const extention = fileType.split('/').at(1)?.toLowerCase() const acceptedExtensions = accept.split(',').map((ext) => ext.trim().toLowerCase()) // 受け入れ可能な拡張子のリストをループします for (const acceptedExtension of acceptedExtensions) { const _item = acceptedExtension.split('/').at(0) const _extention = acceptedExtension.split('/').at(1) if (_item === item) { return _extention === '*' || _extention === extention } } return false }