File tree 2 files changed +22
-2
lines changed
src/idom/client/app/packages/idom-client-react
2 files changed +22
-2
lines changed Original file line number Diff line number Diff line change
1
+ import { copyAttributes } from "./utils.js" ;
2
+
1
3
function serializeEvent ( event ) {
2
4
const data = { } ;
3
5
@@ -23,7 +25,18 @@ const targetTransformCategories = {
23
25
currentTime : target . currentTime ,
24
26
} ) ,
25
27
hasFiles : ( target ) => {
26
- return target . type && target . type == "file" ? { files : target . files } : { } ;
28
+ if ( target ?. type == "file" ) {
29
+ return {
30
+ files : Array . from ( target . files ) . map ( ( file ) => ( {
31
+ lastModified : file . lastModified ,
32
+ name : file . name ,
33
+ size : file . size ,
34
+ type : file . type ,
35
+ } ) ) ,
36
+ } ;
37
+ } else {
38
+ return { } ;
39
+ }
27
40
} ,
28
41
} ;
29
42
Original file line number Diff line number Diff line change @@ -4,7 +4,14 @@ import serializeEvent from "../src/event-to-object.js";
4
4
import "./tooling/setup.js" ;
5
5
6
6
const allTargetData = {
7
- files : [ "path/to/some/file" ] ,
7
+ files : [
8
+ {
9
+ lastModified : 0 ,
10
+ name : "something" ,
11
+ type : "some-type" ,
12
+ size : 0 ,
13
+ } ,
14
+ ] ,
8
15
value : "something" ,
9
16
currentTime : 35 ,
10
17
tagName : null , // overwritten in tests
You can’t perform that action at this time.
0 commit comments