Sha256: bb709c9d20f767281982e198d7b3c9fbcfdea431daad296119dc2f3eb2ae6816
Contents?: true
Size: 637 Bytes
Versions: 26
Compression:
Stored size: 637 Bytes
Contents
// FileList can not be created per constructor. function createFileList(window, files) { const list = { ...files, length: files.length, item: (index)=>list[index], [Symbol.iterator]: function* nextFile() { for(let i = 0; i < list.length; i++){ yield list[i]; } } }; list.constructor = window.FileList; // guard for environments without FileList /* istanbul ignore else */ if (window.FileList) { Object.setPrototypeOf(list, window.FileList.prototype); } Object.freeze(list); return list; } export { createFileList };
Version data entries
26 entries across 26 versions & 1 rubygems