GoogleChromeLabs / browser-fs-access

File System Access API with legacy fallback in the browser
https://googlechromelabs.github.io/browser-fs-access/demo/
Apache License 2.0
1.37k stars 82 forks source link

example code: Cannot redeclare block-scoped variable 'blob' #128

Closed milahu closed 1 year ago

milahu commented 1 year ago

example code in readme is invalid javascript

  // Open a file.
  const blob = await fileOpen({
    mimeTypes: ['image/*'],
  });

  // Save a `Promise<Blob>` that will be streamed.
  // No need to `await` the `Blob` to be created.
  const blob = createBlobAsyncWhichMightTakeLonger(someData);
  await fileSave(response, {
    fileName: 'Untitled.png',
    extensions: ['.png'],
  });

quickfix: const -> var