MCPcopy Index your code
hub / github.com/adobe/react-spectrum / blobToString

Function blobToString

packages/react-aria/src/dnd/utils.ts:296–311  ·  view source on GitHub ↗
(blob: Blob)

Source from the content-addressed store, hash-verified

294}
295
296function blobToString(blob: Blob): Promise<string> {
297 if (typeof blob.text === 'function') {
298 return blob.text();
299 }
300
301 // Safari doesn't have the Blob#text() method yet...
302 return new Promise((resolve, reject) => {
303 let reader = new FileReader();
304 reader.onload = () => {
305 resolve(reader.result as string);
306 };
307
308 reader.onerror = reject;
309 reader.readAsText(blob);
310 });
311}
312
313function createFileItem(file: File | null): FileDropItem {
314 if (!file) {

Callers 2

createFileItemFunction · 0.85
packageFunction · 0.85

Calls 1

resolveFunction · 0.50

Tested by

no test coverage detected