(file)
| 137 | } |
| 138 | |
| 139 | async asyncReadFile(file) { |
| 140 | this.updateProgressBar(); |
| 141 | const decoder = globalThis.TextDecoderStream; |
| 142 | if (decoder) { |
| 143 | await this._streamFile(file, decoder); |
| 144 | } else { |
| 145 | await this._readFullFile(file); |
| 146 | } |
| 147 | this._updateLabel(`Finished loading '${file.name}'.`); |
| 148 | this.dispatchEvent( |
| 149 | new CustomEvent('fileuploadend', {bubbles: true, composed: true})); |
| 150 | this.root.className = 'done'; |
| 151 | } |
| 152 | |
| 153 | async _readFullFile(file) { |
| 154 | const text = await file.text(); |
no test coverage detected