Change extName to use utils.js extname

This commit is contained in:
Tyrone Yeh 2024-04-18 09:49:32 +08:00
parent b7828ad174
commit 64cffdd62e
No known key found for this signature in database
GPG Key ID: A0725352B993FBDD
1 changed files with 2 additions and 2 deletions

View File

@ -1,4 +1,5 @@
import {debounce} from 'throttle-debounce';
import {extname} from '../utils.js';
function elementsCall(el, func, ...args) {
if (typeof el === 'string' || el instanceof String) {
@ -271,8 +272,7 @@ export function getPastedContent(e) {
for (const item of data ?? []) {
if (item?.kind === 'file') {
const file = item.getAsFile();
const extName = file.name.slice(file.name.lastIndexOf('.'), file.name.length);
if (acceptedFiles.includes(extName)) {
if (acceptedFiles.includes(extname(file.name))) {
files.push(file);
}
}