()
| 20814 | has a "fully-sync" SAH impl, else a rejected Promise. |
| 20815 | */ |
| 20816 | const apiVersionCheck = async ()=>{ |
| 20817 | const dh = await navigator.storage.getDirectory(); |
| 20818 | const fn = '.opfs-sahpool-sync-check-'+getRandomName(); |
| 20819 | const fh = await dh.getFileHandle(fn, { create: true }); |
| 20820 | const ah = await fh.createSyncAccessHandle(); |
| 20821 | const close = ah.close(); |
| 20822 | await close; |
| 20823 | await dh.removeEntry(fn); |
| 20824 | if(close?.then){ |
| 20825 | toss("The local OPFS API is too old for opfs-sahpool:", |
| 20826 | "it has an async FileSystemSyncAccessHandle.close() method."); |
| 20827 | } |
| 20828 | return true; |
| 20829 | }; |
| 20830 | |
| 20831 | /** |
| 20832 | installOpfsSAHPoolVfs() asynchronously initializes the OPFS |
no test coverage detected