@cocreate/file 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.9.6](https://github.com/CoCreate-app/CoCreate-file/compare/v1.9.5...v1.9.6) (2023-10-17)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * await getValue() ([93a475a](https://github.com/CoCreate-app/CoCreate-file/commit/93a475ae31a77d9dd804b87539524fe75a8249b6))
7
+
1
8
  ## [1.9.5](https://github.com/CoCreate-app/CoCreate-file/compare/v1.9.4...v1.9.5) (2023-10-14)
2
9
 
3
10
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/file",
3
- "version": "1.9.5",
3
+ "version": "1.9.6",
4
4
  "description": "A headless file uploader that uses HTML5 attributes for customization. Allows easy upload of files to server.",
5
5
  "keywords": [
6
6
  "file",
package/src/client.js CHANGED
@@ -203,7 +203,7 @@ async function getFiles(fileInputs) {
203
203
  if (!file.src)
204
204
  file = await readFile(file)
205
205
 
206
- file = getCustomData({ ...file })
206
+ file = await getCustomData({ ...file })
207
207
  files.push(file)
208
208
  }
209
209
  }
@@ -213,14 +213,14 @@ async function getFiles(fileInputs) {
213
213
  }
214
214
 
215
215
  // gets file custom data
216
- function getCustomData(file) {
216
+ async function getCustomData(file) {
217
217
  let form = document.querySelector(`[file_id="${file.id}"]`);
218
218
  if (form) {
219
219
  let elements = form.querySelectorAll('[file]');
220
220
  for (let i = 0; i < elements.length; i++) {
221
221
  let name = elements[i].getAttribute('file')
222
222
  if (name) {
223
- file[name] = elements[i].getValue()
223
+ file[name] = await elements[i].getValue()
224
224
  }
225
225
  }
226
226
  }