Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Commit f876171

Browse files
committed
fix: linting on transfer-files example
1 parent 92d3fbe commit f876171

File tree

1 file changed

+5
-4
lines changed
  • examples/transfer-files/public/js

1 file changed

+5
-4
lines changed

examples/transfer-files/public/js/app.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
'use strict'
12
/* global self */
23

34
const $startButton = document.querySelector('#start')
@@ -126,16 +127,16 @@ function onDrop (event) {
126127
event.preventDefault()
127128
const dt = event.dataTransfer
128129
const files = dt.files
129-
const readFileContents = (file) => {
130+
131+
function readFileContents (file) {
130132
return new Promise((resolve) => {
131133
const reader = new window.FileReader()
132134
reader.onload = (event) => resolve(event.target.result)
133135
reader.readAsArrayBuffer(file)
134136
})
135137
}
136138

137-
for (var i = 0; i < files.length; i++) {
138-
const file = files[i]
139+
files.map((file) => {
139140
readFileContents(file)
140141
.then((buffer) => {
141142
return node.files.add([{
@@ -150,7 +151,7 @@ function onDrop (event) {
150151
.join('<br>')
151152
})
152153
.catch(onError)
153-
}
154+
})
154155
}
155156

156157
/*

0 commit comments

Comments
 (0)