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.38k stars 84 forks source link

Fix fileSave return type #68

Closed niedzielski closed 2 years ago

niedzielski commented 2 years ago

The docs for fileSave() are correct, the return type is optional. However, the typing promised to always return a defined FileSystemHandle. This patch makes the return type optional to forgive the legacy behavior.

null is used over undefined to match project typing conventions. As such, a functional change to unconditionally return null was necessary in the legacy implementation.

tomayac commented 2 years ago

Released: https://github.com/GoogleChromeLabs/browser-fs-access/releases/tag/v0.20.5