From e1c9851e980814d95cc7f2219b4bf82e02fcfffe Mon Sep 17 00:00:00 2001 From: Anton Arnautov <43254280+arnautov-anton@users.noreply.github.com> Date: Mon, 5 Jul 2021 09:17:38 +0200 Subject: [PATCH] Replaced methods with array indexing (#279) --- src/utils/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/index.ts b/src/utils/index.ts index 0968dc81..5cfc6d57 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -75,7 +75,7 @@ export function dataTransferItemsHaveFiles(items?: DataTransferItemList) { function getFileLikes(items: DataTransferItemList) { const fileLikes: Array = []; for (let i = 0; i < items.length; i += 1) { - const item = items.item(i); + const item = items[i]; if (item.kind === 'file') { const file = item.getAsFile(); if (file) fileLikes.push(file); @@ -95,7 +95,7 @@ export async function dataTransferItemsToFiles(items?: DataTransferItemList) { const blobPromises = []; const parser = new DOMParser(); for (let i = 0; i < items.length; i += 1) { - const item = items.item(i); + const item = items[i]; if (item.type === 'text/html') { blobPromises.push( new Promise((accept) => {