@fgv/ts-web-extras 5.1.0-0 → 5.1.0-2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.rush/temp/chunked-rush-logs/ts-web-extras.build.chunks.jsonl +56 -33
- package/.rush/temp/chunked-rush-logs/ts-web-extras.test.chunks.jsonl +75 -0
- package/.rush/temp/operation/build/all.log +56 -33
- package/.rush/temp/operation/build/error.log +18 -0
- package/.rush/temp/operation/build/log-chunks.jsonl +56 -33
- package/.rush/temp/operation/build/state.json +1 -1
- package/.rush/temp/operation/test/all.log +75 -0
- package/.rush/temp/operation/test/error.log +18 -0
- package/.rush/temp/operation/test/log-chunks.jsonl +75 -0
- package/.rush/temp/operation/test/state.json +3 -0
- package/dist/packlets/file-tree/fileApiTreeAccessors.js +15 -0
- package/dist/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
- package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js +79 -10
- package/dist/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -1
- package/dist/packlets/file-tree/httpTreeAccessors.js +336 -0
- package/dist/packlets/file-tree/httpTreeAccessors.js.map +1 -0
- package/dist/packlets/file-tree/index.js +1 -0
- package/dist/packlets/file-tree/index.js.map +1 -1
- package/dist/packlets/file-tree/localStorageTreeAccessors.js +51 -0
- package/dist/packlets/file-tree/localStorageTreeAccessors.js.map +1 -1
- package/dist/test/unit/fileApiTreeAccessors.test.js +51 -0
- package/dist/test/unit/fileApiTreeAccessors.test.js.map +1 -1
- package/dist/test/unit/fileSystemAccessTreeAccessors.test.js +265 -160
- package/dist/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -1
- package/dist/test/unit/httpTreeAccessors.test.js +1229 -0
- package/dist/test/unit/httpTreeAccessors.test.js.map +1 -0
- package/dist/test/unit/localStorageTreeAccessors.test.js +218 -1
- package/dist/test/unit/localStorageTreeAccessors.test.js.map +1 -1
- package/dist/ts-web-extras.d.ts +138 -0
- package/docs/@fgv/namespaces/CryptoUtils/README.md +18 -0
- package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserCryptoProvider.md +203 -0
- package/docs/@fgv/namespaces/CryptoUtils/classes/BrowserHashProvider.md +63 -0
- package/docs/@fgv/namespaces/CryptoUtils/functions/createBrowserCryptoProvider.md +18 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/README.md +19 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileListMetadata.md +23 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/extractFileMetadata.md +23 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromDirectoryUpload.md +33 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/fromFileList.md +33 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/functions/getOriginalFile.md +25 -0
- package/docs/@fgv/namespaces/FileTreeHelpers/variables/defaultFileApiTreeInitParams.md +11 -0
- package/docs/README.md +78 -0
- package/docs/classes/DirectoryHandleStore.md +116 -0
- package/docs/classes/FileApiTreeAccessors.md +286 -0
- package/docs/classes/FileSystemAccessTreeAccessors.md +557 -0
- package/docs/classes/HttpTreeAccessors.md +508 -0
- package/docs/classes/LocalStorageTreeAccessors.md +520 -0
- package/docs/functions/exportAsJson.md +23 -0
- package/docs/functions/exportUsingFileSystemAPI.md +26 -0
- package/docs/functions/extractDirectoryPath.md +23 -0
- package/docs/functions/isDirectoryHandle.md +23 -0
- package/docs/functions/isFileHandle.md +23 -0
- package/docs/functions/isFilePath.md +21 -0
- package/docs/functions/parseContextFilter.md +22 -0
- package/docs/functions/parseQualifierDefaults.md +22 -0
- package/docs/functions/parseResourceTypes.md +22 -0
- package/docs/functions/parseUrlParameters.md +15 -0
- package/docs/functions/safeShowDirectoryPicker.md +24 -0
- package/docs/functions/safeShowOpenFilePicker.md +24 -0
- package/docs/functions/safeShowSaveFilePicker.md +24 -0
- package/docs/functions/supportsFileSystemAccess.md +23 -0
- package/docs/interfaces/FilePickerAcceptType.md +16 -0
- package/docs/interfaces/FileSystemCreateWritableOptions.md +15 -0
- package/docs/interfaces/FileSystemDirectoryHandle.md +187 -0
- package/docs/interfaces/FileSystemFileHandle.md +106 -0
- package/docs/interfaces/FileSystemGetDirectoryOptions.md +15 -0
- package/docs/interfaces/FileSystemGetFileOptions.md +15 -0
- package/docs/interfaces/FileSystemHandle.md +69 -0
- package/docs/interfaces/FileSystemHandlePermissionDescriptor.md +15 -0
- package/docs/interfaces/FileSystemRemoveOptions.md +15 -0
- package/docs/interfaces/FileSystemWritableFileStream.md +127 -0
- package/docs/interfaces/IDirectoryHandleTreeInitializer.md +17 -0
- package/docs/interfaces/IFileHandleTreeInitializer.md +16 -0
- package/docs/interfaces/IFileListTreeInitializer.md +15 -0
- package/docs/interfaces/IFileMetadata.md +19 -0
- package/docs/interfaces/IFileSystemAccessTreeParams.md +30 -0
- package/docs/interfaces/IFsAccessApis.md +57 -0
- package/docs/interfaces/IHttpTreeParams.md +32 -0
- package/docs/interfaces/ILocalStorageTreeParams.md +30 -0
- package/docs/interfaces/IUrlConfigOptions.md +27 -0
- package/docs/interfaces/ShowDirectoryPickerOptions.md +17 -0
- package/docs/interfaces/ShowOpenFilePickerOptions.md +19 -0
- package/docs/interfaces/ShowSaveFilePickerOptions.md +19 -0
- package/docs/type-aliases/TreeInitializer.md +11 -0
- package/docs/type-aliases/WellKnownDirectory.md +11 -0
- package/docs/type-aliases/WindowWithFsAccess.md +11 -0
- package/docs/variables/DEFAULT_DIRECTORY_HANDLE_DB.md +11 -0
- package/docs/variables/DEFAULT_DIRECTORY_HANDLE_STORE.md +11 -0
- package/etc/ts-web-extras.api.md +33 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts +9 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.d.ts.map +1 -1
- package/lib/packlets/file-tree/fileApiTreeAccessors.js +15 -0
- package/lib/packlets/file-tree/fileApiTreeAccessors.js.map +1 -1
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts +17 -1
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.d.ts.map +1 -1
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js +78 -9
- package/lib/packlets/file-tree/fileSystemAccessTreeAccessors.js.map +1 -1
- package/lib/packlets/file-tree/httpTreeAccessors.d.ts +102 -0
- package/lib/packlets/file-tree/httpTreeAccessors.d.ts.map +1 -0
- package/lib/packlets/file-tree/httpTreeAccessors.js +340 -0
- package/lib/packlets/file-tree/httpTreeAccessors.js.map +1 -0
- package/lib/packlets/file-tree/index.d.ts +1 -0
- package/lib/packlets/file-tree/index.d.ts.map +1 -1
- package/lib/packlets/file-tree/index.js +1 -0
- package/lib/packlets/file-tree/index.js.map +1 -1
- package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts +12 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.d.ts.map +1 -1
- package/lib/packlets/file-tree/localStorageTreeAccessors.js +51 -0
- package/lib/packlets/file-tree/localStorageTreeAccessors.js.map +1 -1
- package/lib/test/unit/fileApiTreeAccessors.test.js +51 -0
- package/lib/test/unit/fileApiTreeAccessors.test.js.map +1 -1
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.js +265 -160
- package/lib/test/unit/fileSystemAccessTreeAccessors.test.js.map +1 -1
- package/lib/test/unit/httpTreeAccessors.test.d.ts +2 -0
- package/lib/test/unit/httpTreeAccessors.test.d.ts.map +1 -0
- package/lib/test/unit/httpTreeAccessors.test.js +1231 -0
- package/lib/test/unit/httpTreeAccessors.test.js.map +1 -0
- package/lib/test/unit/localStorageTreeAccessors.test.js +218 -1
- package/lib/test/unit/localStorageTreeAccessors.test.js.map +1 -1
- package/package.json +25 -25
- package/rush-logs/ts-web-extras.build.cache.log +0 -3
- package/rush-logs/ts-web-extras.build.error.log +18 -0
- package/rush-logs/ts-web-extras.build.log +56 -33
- package/rush-logs/ts-web-extras.test.cache.log +1 -0
- package/rush-logs/ts-web-extras.test.error.log +18 -0
- package/rush-logs/ts-web-extras.test.log +75 -0
- package/src/packlets/file-tree/fileApiTreeAccessors.ts +18 -0
- package/src/packlets/file-tree/fileSystemAccessTreeAccessors.ts +100 -8
- package/src/packlets/file-tree/httpTreeAccessors.ts +448 -0
- package/src/packlets/file-tree/index.ts +1 -0
- package/src/packlets/file-tree/localStorageTreeAccessors.ts +53 -0
- package/src/test/unit/fileApiTreeAccessors.test.ts +69 -0
- package/src/test/unit/fileSystemAccessTreeAccessors.test.ts +341 -188
- package/src/test/unit/httpTreeAccessors.test.ts +1571 -0
- package/src/test/unit/localStorageTreeAccessors.test.ts +269 -1
- package/temp/build/typescript/ts_8nwakTlr.json +1 -1
- package/temp/coverage/crypto/browserHashProvider.ts.html +304 -0
- package/temp/coverage/crypto/index.html +116 -0
- package/temp/coverage/crypto-utils/browserCryptoProvider.ts.html +1 -1
- package/temp/coverage/crypto-utils/browserHashProvider.ts.html +1 -1
- package/temp/coverage/crypto-utils/index.html +1 -1
- package/temp/coverage/file-tree/directoryHandleStore.ts.html +1 -1
- package/temp/coverage/file-tree/fileApiTreeAccessors.ts.html +60 -6
- package/temp/coverage/file-tree/fileSystemAccessTreeAccessors.ts.html +410 -134
- package/temp/coverage/file-tree/httpTreeAccessors.ts.html +1429 -0
- package/temp/coverage/file-tree/index.html +35 -20
- package/temp/coverage/file-tree/localStorageTreeAccessors.ts.html +318 -159
- package/temp/coverage/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/helpers/index.html +1 -1
- package/temp/coverage/index.html +11 -11
- package/temp/coverage/lcov-report/crypto/browserHashProvider.ts.html +304 -0
- package/temp/coverage/lcov-report/crypto/index.html +116 -0
- package/temp/coverage/lcov-report/crypto-utils/browserCryptoProvider.ts.html +1 -1
- package/temp/coverage/lcov-report/crypto-utils/browserHashProvider.ts.html +1 -1
- package/temp/coverage/lcov-report/crypto-utils/index.html +1 -1
- package/temp/coverage/lcov-report/file-tree/directoryHandleStore.ts.html +1 -1
- package/temp/coverage/lcov-report/file-tree/fileApiTreeAccessors.ts.html +60 -6
- package/temp/coverage/lcov-report/file-tree/fileSystemAccessTreeAccessors.ts.html +410 -134
- package/temp/coverage/lcov-report/file-tree/httpTreeAccessors.ts.html +1429 -0
- package/temp/coverage/lcov-report/file-tree/index.html +35 -20
- package/temp/coverage/lcov-report/file-tree/localStorageTreeAccessors.ts.html +318 -159
- package/temp/coverage/lcov-report/helpers/fileTreeHelpers.ts.html +1 -1
- package/temp/coverage/lcov-report/helpers/index.html +1 -1
- package/temp/coverage/lcov-report/index.html +11 -11
- package/temp/coverage/lcov-report/url-utils/index.html +1 -1
- package/temp/coverage/lcov-report/url-utils/urlParams.ts.html +1 -1
- package/temp/coverage/lcov.info +2021 -1197
- package/temp/coverage/url-utils/index.html +1 -1
- package/temp/coverage/url-utils/urlParams.ts.html +1 -1
- package/temp/test/jest/haste-map-b931e4e63102f86c5bd4949f7dced44f-9d713eb41149188b4e5c0ae3d86d0a57-2ad8e16b24e391b8cdbe50b55c137169 +0 -0
- package/temp/test/jest/perf-cache-b931e4e63102f86c5bd4949f7dced44f-da39a3ee5e6b4b0d3255bfef95601890 +1 -0
- package/temp/ts-web-extras.api.json +1313 -354
- package/temp/ts-web-extras.api.md +33 -0
- package/.rush/temp/81e0881271ff236956b2f52e8ca99da6574c6e1e.tar.log +0 -223
- package/docs/index.md +0 -34
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider._constructor_.md +0 -50
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.decrypt.md +0 -104
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.derivekey.md +0 -88
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.encrypt.md +0 -72
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.frombase64.md +0 -56
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generatekey.md +0 -19
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.generaterandombytes.md +0 -56
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.md +0 -169
- package/docs/ts-web-extras.cryptoutils.browsercryptoprovider.tobase64.md +0 -56
- package/docs/ts-web-extras.cryptoutils.browserhashprovider.hashparts.md +0 -88
- package/docs/ts-web-extras.cryptoutils.browserhashprovider.hashstring.md +0 -72
- package/docs/ts-web-extras.cryptoutils.browserhashprovider.md +0 -66
- package/docs/ts-web-extras.cryptoutils.createbrowsercryptoprovider.md +0 -19
- package/docs/ts-web-extras.cryptoutils.md +0 -71
- package/docs/ts-web-extras.exportasjson.md +0 -70
- package/docs/ts-web-extras.exportusingfilesystemapi.md +0 -104
- package/docs/ts-web-extras.extractdirectorypath.md +0 -52
- package/docs/ts-web-extras.fileapitreeaccessors.create.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.createfromlocalstorage.md +0 -74
- package/docs/ts-web-extras.fileapitreeaccessors.createpersistent.md +0 -76
- package/docs/ts-web-extras.fileapitreeaccessors.extractfilemetadata.md +0 -54
- package/docs/ts-web-extras.fileapitreeaccessors.fromdirectoryupload.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.fromfilelist.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.getoriginalfile.md +0 -72
- package/docs/ts-web-extras.fileapitreeaccessors.md +0 -146
- package/docs/ts-web-extras.filepickeraccepttype.accept.md +0 -11
- package/docs/ts-web-extras.filepickeraccepttype.description.md +0 -11
- package/docs/ts-web-extras.filepickeraccepttype.md +0 -75
- package/docs/ts-web-extras.filesystemaccesstreeaccessors._constructor_.md +0 -114
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.fileismutable.md +0 -52
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.fromdirectoryhandle.md +0 -72
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.getdirtypaths.md +0 -17
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.isdirty.md +0 -17
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.md +0 -159
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.savefilecontents.md +0 -66
- package/docs/ts-web-extras.filesystemaccesstreeaccessors.synctodisk.md +0 -17
- package/docs/ts-web-extras.filesystemcreatewritableoptions_2.keepexistingdata.md +0 -11
- package/docs/ts-web-extras.filesystemcreatewritableoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemdirectoryhandle_2._symbol.asynciterator_.md +0 -15
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.entries.md +0 -15
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.getdirectoryhandle.md +0 -66
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.getfilehandle.md +0 -66
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.keys.md +0 -15
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.kind.md +0 -11
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.md +0 -146
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.removeentry.md +0 -66
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.resolve.md +0 -50
- package/docs/ts-web-extras.filesystemdirectoryhandle_2.values.md +0 -15
- package/docs/ts-web-extras.filesystemfilehandle_2.createwritable.md +0 -52
- package/docs/ts-web-extras.filesystemfilehandle_2.getfile.md +0 -15
- package/docs/ts-web-extras.filesystemfilehandle_2.kind.md +0 -11
- package/docs/ts-web-extras.filesystemfilehandle_2.md +0 -92
- package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.create.md +0 -11
- package/docs/ts-web-extras.filesystemgetdirectoryoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemgetfileoptions_2.create.md +0 -11
- package/docs/ts-web-extras.filesystemgetfileoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemhandle_2.issameentry.md +0 -50
- package/docs/ts-web-extras.filesystemhandle_2.kind.md +0 -11
- package/docs/ts-web-extras.filesystemhandle_2.md +0 -119
- package/docs/ts-web-extras.filesystemhandle_2.name.md +0 -11
- package/docs/ts-web-extras.filesystemhandle_2.querypermission.md +0 -52
- package/docs/ts-web-extras.filesystemhandle_2.requestpermission.md +0 -52
- package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.md +0 -58
- package/docs/ts-web-extras.filesystemhandlepermissiondescriptor.mode.md +0 -11
- package/docs/ts-web-extras.filesystemremoveoptions_2.md +0 -58
- package/docs/ts-web-extras.filesystemremoveoptions_2.recursive.md +0 -11
- package/docs/ts-web-extras.filesystemwritablefilestream_2.md +0 -57
- package/docs/ts-web-extras.filesystemwritablefilestream_2.seek.md +0 -50
- package/docs/ts-web-extras.filesystemwritablefilestream_2.truncate.md +0 -50
- package/docs/ts-web-extras.filesystemwritablefilestream_2.write.md +0 -50
- package/docs/ts-web-extras.filetreehelpers.defaultfileapitreeinitparams.md +0 -13
- package/docs/ts-web-extras.filetreehelpers.extractfilelistmetadata.md +0 -56
- package/docs/ts-web-extras.filetreehelpers.extractfilemetadata.md +0 -56
- package/docs/ts-web-extras.filetreehelpers.fromdirectoryupload.md +0 -76
- package/docs/ts-web-extras.filetreehelpers.fromfilelist.md +0 -76
- package/docs/ts-web-extras.filetreehelpers.getoriginalfile.md +0 -72
- package/docs/ts-web-extras.filetreehelpers.md +0 -102
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.dirhandles.md +0 -11
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.md +0 -100
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.nonrecursive.md +0 -11
- package/docs/ts-web-extras.idirectoryhandletreeinitializer.prefix.md +0 -11
- package/docs/ts-web-extras.ifilehandletreeinitializer.filehandles.md +0 -11
- package/docs/ts-web-extras.ifilehandletreeinitializer.md +0 -79
- package/docs/ts-web-extras.ifilehandletreeinitializer.prefix.md +0 -11
- package/docs/ts-web-extras.ifilelisttreeinitializer.filelist.md +0 -11
- package/docs/ts-web-extras.ifilelisttreeinitializer.md +0 -58
- package/docs/ts-web-extras.ifilemetadata.lastmodified.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.md +0 -124
- package/docs/ts-web-extras.ifilemetadata.name.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.path.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.size.md +0 -11
- package/docs/ts-web-extras.ifilemetadata.type.md +0 -11
- package/docs/ts-web-extras.ifilesystemaccesstreeparams.autosync.md +0 -13
- package/docs/ts-web-extras.ifilesystemaccesstreeparams.md +0 -78
- package/docs/ts-web-extras.ifilesystemaccesstreeparams.requirewritepermission.md +0 -13
- package/docs/ts-web-extras.ifsaccessapis.md +0 -56
- package/docs/ts-web-extras.ifsaccessapis.showdirectorypicker.md +0 -52
- package/docs/ts-web-extras.ifsaccessapis.showopenfilepicker.md +0 -52
- package/docs/ts-web-extras.ifsaccessapis.showsavefilepicker.md +0 -52
- package/docs/ts-web-extras.ilocalstoragetreeparams.autosync.md +0 -13
- package/docs/ts-web-extras.ilocalstoragetreeparams.md +0 -97
- package/docs/ts-web-extras.ilocalstoragetreeparams.pathtokeymap.md +0 -13
- package/docs/ts-web-extras.ilocalstoragetreeparams.storage.md +0 -13
- package/docs/ts-web-extras.isdirectoryhandle.md +0 -56
- package/docs/ts-web-extras.isfilehandle.md +0 -56
- package/docs/ts-web-extras.isfilepath.md +0 -52
- package/docs/ts-web-extras.iurlconfigoptions.config.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.configstartdir.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.contextfilter.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.input.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.inputstartdir.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.interactive.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.loadzip.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.maxdistance.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.md +0 -286
- package/docs/ts-web-extras.iurlconfigoptions.qualifierdefaults.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.reducequalifiers.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.resourcetypes.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.zipfile.md +0 -13
- package/docs/ts-web-extras.iurlconfigoptions.zippath.md +0 -13
- package/docs/ts-web-extras.localstoragetreeaccessors.fileismutable.md +0 -56
- package/docs/ts-web-extras.localstoragetreeaccessors.fromstorage.md +0 -56
- package/docs/ts-web-extras.localstoragetreeaccessors.getdirtypaths.md +0 -19
- package/docs/ts-web-extras.localstoragetreeaccessors.isdirty.md +0 -19
- package/docs/ts-web-extras.localstoragetreeaccessors.md +0 -131
- package/docs/ts-web-extras.localstoragetreeaccessors.savefilecontents.md +0 -72
- package/docs/ts-web-extras.localstoragetreeaccessors.synctodisk.md +0 -19
- package/docs/ts-web-extras.md +0 -558
- package/docs/ts-web-extras.parsecontextfilter.md +0 -52
- package/docs/ts-web-extras.parsequalifierdefaults.md +0 -52
- package/docs/ts-web-extras.parseresourcetypes.md +0 -52
- package/docs/ts-web-extras.parseurlparameters.md +0 -17
- package/docs/ts-web-extras.safeshowdirectorypicker.md +0 -72
- package/docs/ts-web-extras.safeshowopenfilepicker.md +0 -72
- package/docs/ts-web-extras.safeshowsavefilepicker.md +0 -72
- package/docs/ts-web-extras.showdirectorypickeroptions.id.md +0 -11
- package/docs/ts-web-extras.showdirectorypickeroptions.md +0 -96
- package/docs/ts-web-extras.showdirectorypickeroptions.mode.md +0 -11
- package/docs/ts-web-extras.showdirectorypickeroptions.startin.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.excludeacceptalloption.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.id.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.md +0 -134
- package/docs/ts-web-extras.showopenfilepickeroptions.multiple.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.startin.md +0 -11
- package/docs/ts-web-extras.showopenfilepickeroptions.types.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.excludeacceptalloption.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.id.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.md +0 -134
- package/docs/ts-web-extras.showsavefilepickeroptions.startin.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.suggestedname.md +0 -11
- package/docs/ts-web-extras.showsavefilepickeroptions.types.md +0 -11
- package/docs/ts-web-extras.supportsfilesystemaccess.md +0 -56
- package/docs/ts-web-extras.treeinitializer.md +0 -15
- package/docs/ts-web-extras.wellknowndirectory.md +0 -13
- package/docs/ts-web-extras.windowwithfsaccess.md +0 -15
- package/temp/test/jest/haste-map-7492f1b44480e0cdd1f220078fb3afd8-c8dd6c3430605adeb2f1cadf4f75e791-8c9336785555d572065b28c111982ba4 +0 -0
- package/temp/test/jest/perf-cache-7492f1b44480e0cdd1f220078fb3afd8-da39a3ee5e6b4b0d3255bfef95601890 +0 -1
- /package/temp/test/jest/{jest-transform-cache-7492f1b44480e0cdd1f220078fb3afd8-79ef2876fae7ca75eedb2aa53dc48338/8d/package_8dcbedef69e4299f0f51fcda8f4f1c8e → jest-transform-cache-b931e4e63102f86c5bd4949f7dced44f-79ef2876fae7ca75eedb2aa53dc48338/b5/package_b5f57afc9ec2c011239b1608ee5bdfa5} +0 -0
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
Invoking: heft test --clean
|
|
2
|
+
---- build started ----
|
|
3
|
+
[build:clean] Deleted 0 files and 3 folders
|
|
4
|
+
[build:typescript] The TypeScript compiler version 5.9.3 is newer than the latest version that was tested with Heft (5.8); it may not work correctly.
|
|
5
|
+
[build:typescript] Using TypeScript version 5.9.3
|
|
6
|
+
[build:api-extractor] Using API Extractor version 7.57.6
|
|
7
|
+
[build:api-extractor] Analysis will use the bundled TypeScript version 5.8.2
|
|
8
|
+
[build:api-extractor] *** The target project appears to use TypeScript 5.9.3 which is newer than the bundled compiler engine; consider upgrading API Extractor.
|
|
9
|
+
---- build finished (3.976s) ----
|
|
10
|
+
---- test started ----
|
|
11
|
+
[test:clean] Deleted 0 files and 1 folder
|
|
12
|
+
[test:jest] Using Jest version 29.5.0
|
|
13
|
+
[test:jest]
|
|
14
|
+
[test:jest] Run start. 9 test suites
|
|
15
|
+
[test:jest] START lib/test/unit/fileApiTreeAccessors.test.js
|
|
16
|
+
[test:jest] START lib/test/unit/httpTreeAccessors.test.js
|
|
17
|
+
[test:jest] START lib/test/unit/localStorageTreeAccessors.test.js
|
|
18
|
+
[test:jest] START lib/test/unit/fileSystemAccessTreeAccessors.test.js
|
|
19
|
+
[test:jest] START lib/test/unit/fileTreeHelpers.test.js
|
|
20
|
+
[test:jest] START lib/test/unit/fileApiTypes.test.js
|
|
21
|
+
[test:jest] START lib/test/unit/urlParams.test.js
|
|
22
|
+
[test:jest] START lib/test/unit/directoryHandleStore.test.js
|
|
23
|
+
[test:jest] START lib/test/unit/browserHashProvider.test.js
|
|
24
|
+
(node:99490) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
25
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
26
|
+
(node:99493) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
27
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
28
|
+
[test:jest] PASS lib/test/unit/urlParams.test.js (duration: 0.793s, 60 passed, 0 failed)
|
|
29
|
+
[test:jest] PASS lib/test/unit/fileSystemAccessTreeAccessors.test.js (duration: 0.886s, 44 passed, 0 failed)
|
|
30
|
+
(node:99494) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
31
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
32
|
+
[test:jest] PASS lib/test/unit/directoryHandleStore.test.js (duration: 0.868s, 19 passed, 0 failed)
|
|
33
|
+
(node:99488) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
34
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
35
|
+
(node:99489) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
36
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
37
|
+
[test:jest] PASS lib/test/unit/localStorageTreeAccessors.test.js (duration: 0.949s, 44 passed, 0 failed)
|
|
38
|
+
(node:99492) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
39
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
40
|
+
[test:jest] PASS lib/test/unit/fileApiTypes.test.js (duration: 0.931s, 36 passed, 0 failed)
|
|
41
|
+
(node:99495) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
42
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
43
|
+
(node:99487) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
44
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
45
|
+
[test:jest] PASS lib/test/unit/fileApiTreeAccessors.test.js (duration: 1.013s, 65 passed, 0 failed)
|
|
46
|
+
(node:99491) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
|
|
47
|
+
(Use `node --trace-deprecation ...` to show where the warning was created)
|
|
48
|
+
[test:jest] PASS lib/test/unit/fileTreeHelpers.test.js (duration: 0.996s, 35 passed, 0 failed)
|
|
49
|
+
[test:jest] PASS lib/test/unit/httpTreeAccessors.test.js (duration: 1.015s, 57 passed, 0 failed)
|
|
50
|
+
[test:jest] PASS lib/test/unit/browserHashProvider.test.js (duration: 1.021s, 15 passed, 0 failed)
|
|
51
|
+
[test:jest]
|
|
52
|
+
[test:jest] Tests finished:
|
|
53
|
+
[test:jest] Successes: 375
|
|
54
|
+
[test:jest] Failures: 0
|
|
55
|
+
[test:jest] Total: 376
|
|
56
|
+
-----------------------------------|---------|----------|---------|---------|-------------------
|
|
57
|
+
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
|
|
58
|
+
-----------------------------------|---------|----------|---------|---------|-------------------
|
|
59
|
+
All files | 100 | 99.62 | 100 | 100 |
|
|
60
|
+
crypto-utils | 100 | 100 | 100 | 100 |
|
|
61
|
+
browserCryptoProvider.ts | 100 | 100 | 100 | 100 |
|
|
62
|
+
browserHashProvider.ts | 100 | 100 | 100 | 100 |
|
|
63
|
+
file-tree | 100 | 99.57 | 100 | 100 |
|
|
64
|
+
directoryHandleStore.ts | 100 | 100 | 100 | 100 |
|
|
65
|
+
fileApiTreeAccessors.ts | 100 | 100 | 100 | 100 |
|
|
66
|
+
fileSystemAccessTreeAccessors.ts | 100 | 100 | 100 | 100 |
|
|
67
|
+
httpTreeAccessors.ts | 100 | 98.41 | 100 | 100 | 339
|
|
68
|
+
localStorageTreeAccessors.ts | 100 | 100 | 100 | 100 |
|
|
69
|
+
helpers | 100 | 100 | 100 | 100 |
|
|
70
|
+
fileTreeHelpers.ts | 100 | 100 | 100 | 100 |
|
|
71
|
+
url-utils | 100 | 100 | 100 | 100 |
|
|
72
|
+
urlParams.ts | 100 | 100 | 100 | 100 |
|
|
73
|
+
-----------------------------------|---------|----------|---------|---------|-------------------
|
|
74
|
+
---- test finished (2.232s) ----
|
|
75
|
+
-------------------- Finished (6.215s) --------------------
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
FileSystemDirectoryHandle
|
|
31
31
|
} from '../file-api-types';
|
|
32
32
|
import { FileSystemAccessTreeAccessors, IFileSystemAccessTreeParams } from './fileSystemAccessTreeAccessors';
|
|
33
|
+
import { HttpTreeAccessors, IHttpTreeParams } from './httpTreeAccessors';
|
|
33
34
|
import { LocalStorageTreeAccessors, ILocalStorageTreeParams } from './localStorageTreeAccessors';
|
|
34
35
|
|
|
35
36
|
/**
|
|
@@ -130,6 +131,23 @@ export class FileApiTreeAccessors<TCT extends string = string> {
|
|
|
130
131
|
return FileTree.FileTree.create<TCT>(accessorsResult.value);
|
|
131
132
|
}
|
|
132
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Create a persistent FileTree from an HTTP storage service.
|
|
136
|
+
*
|
|
137
|
+
* @param params - Configuration including API base URL, namespace, and optional autoSync
|
|
138
|
+
* @returns Promise resolving to a FileTree with persistence capability
|
|
139
|
+
* @public
|
|
140
|
+
*/
|
|
141
|
+
public static async createFromHttp<TCT extends string = string>(
|
|
142
|
+
params: IHttpTreeParams<TCT>
|
|
143
|
+
): Promise<Result<FileTree.FileTree<TCT>>> {
|
|
144
|
+
const accessorsResult = await HttpTreeAccessors.fromHttp<TCT>(params);
|
|
145
|
+
if (accessorsResult.isFailure()) {
|
|
146
|
+
return fail(accessorsResult.message);
|
|
147
|
+
}
|
|
148
|
+
return FileTree.FileTree.create<TCT>(accessorsResult.value);
|
|
149
|
+
}
|
|
150
|
+
|
|
133
151
|
/**
|
|
134
152
|
* Create a persistent FileTree from a single File System Access API file handle.
|
|
135
153
|
* The tree contains exactly one file at `/<filename>`.
|
|
@@ -20,7 +20,15 @@
|
|
|
20
20
|
* SOFTWARE.
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
Result,
|
|
25
|
+
succeed,
|
|
26
|
+
fail,
|
|
27
|
+
captureResult,
|
|
28
|
+
DetailedResult,
|
|
29
|
+
succeedWithDetail,
|
|
30
|
+
Logging
|
|
31
|
+
} from '@fgv/ts-utils';
|
|
24
32
|
import { FileTree } from '@fgv/ts-json-base';
|
|
25
33
|
import { FileSystemDirectoryHandle, FileSystemFileHandle } from '../file-api-types';
|
|
26
34
|
|
|
@@ -51,6 +59,9 @@ export interface IFileSystemAccessTreeParams<TCT extends string = string>
|
|
|
51
59
|
* If omitted, defaults to `/<filename>`.
|
|
52
60
|
*/
|
|
53
61
|
filePath?: string;
|
|
62
|
+
|
|
63
|
+
/** Optional logger for auto-sync and persistence failures. */
|
|
64
|
+
logger?: Logging.LogReporter<unknown>;
|
|
54
65
|
}
|
|
55
66
|
|
|
56
67
|
/**
|
|
@@ -65,8 +76,10 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
65
76
|
private readonly _handles: Map<string, FileSystemFileHandle>;
|
|
66
77
|
private readonly _rootDir: FileSystemDirectoryHandle;
|
|
67
78
|
private readonly _dirtyFiles: Set<string>;
|
|
79
|
+
private readonly _pendingDeletions: Set<string>;
|
|
68
80
|
private readonly _autoSync: boolean;
|
|
69
81
|
private readonly _hasWritePermission: boolean;
|
|
82
|
+
private readonly _logger: Logging.LogReporter<unknown>;
|
|
70
83
|
|
|
71
84
|
/**
|
|
72
85
|
* Protected constructor for FileSystemAccessTreeAccessors.
|
|
@@ -87,8 +100,26 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
87
100
|
this._rootDir = rootDir;
|
|
88
101
|
this._handles = handles;
|
|
89
102
|
this._dirtyFiles = new Set();
|
|
103
|
+
this._pendingDeletions = new Set();
|
|
104
|
+
/* c8 ignore next 3 - intermittent branch coverage: ?? fallback branches in constructor */
|
|
90
105
|
this._autoSync = params?.autoSync ?? false;
|
|
91
106
|
this._hasWritePermission = hasWritePermission;
|
|
107
|
+
this._logger = params?.logger ?? new Logging.LogReporter<unknown>();
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
private async _runAutoSyncTask(
|
|
111
|
+
path: string,
|
|
112
|
+
operation: 'save' | 'delete',
|
|
113
|
+
action: () => Promise<Result<void>>
|
|
114
|
+
): Promise<void> {
|
|
115
|
+
try {
|
|
116
|
+
const result = await action();
|
|
117
|
+
if (result.isFailure()) {
|
|
118
|
+
this._logger.error(`Auto-${operation} failed for ${path}: ${result.message}`);
|
|
119
|
+
}
|
|
120
|
+
} catch (err) {
|
|
121
|
+
this._logger.error(`Auto-${operation} threw for ${path}: ${String(err)}`);
|
|
122
|
+
}
|
|
92
123
|
}
|
|
93
124
|
|
|
94
125
|
/**
|
|
@@ -149,6 +180,7 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
149
180
|
try {
|
|
150
181
|
const hasWritePermission = await this._checkFileWritePermission(fileHandle);
|
|
151
182
|
|
|
183
|
+
/* c8 ignore next 1 - intermittent branch coverage: ?? true fallback */
|
|
152
184
|
if (!hasWritePermission && (params?.requireWritePermission ?? true)) {
|
|
153
185
|
return fail('Write permission required but not granted');
|
|
154
186
|
}
|
|
@@ -156,6 +188,7 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
156
188
|
const file = await fileHandle.getFile();
|
|
157
189
|
const contents = await file.text();
|
|
158
190
|
const path = params?.filePath ?? `/${fileHandle.name}`;
|
|
191
|
+
/* c8 ignore next 3 - intermittent branch coverage: ternary for inferContentType */
|
|
159
192
|
const contentType = params?.inferContentType
|
|
160
193
|
? params.inferContentType(path, file.type).orDefault()
|
|
161
194
|
: undefined;
|
|
@@ -166,6 +199,7 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
166
199
|
const dummyRoot = {} as FileSystemDirectoryHandle;
|
|
167
200
|
const effectiveParams: IFileSystemAccessTreeParams<TCT> = {
|
|
168
201
|
...params,
|
|
202
|
+
/* c8 ignore next 1 - intermittent branch coverage: ?? false fallback */
|
|
169
203
|
mutable: hasWritePermission ? true : params?.mutable ?? false
|
|
170
204
|
};
|
|
171
205
|
|
|
@@ -173,6 +207,7 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
173
207
|
new FileSystemAccessTreeAccessors<TCT>(files, dummyRoot, handles, effectiveParams, hasWritePermission)
|
|
174
208
|
);
|
|
175
209
|
} catch (error) {
|
|
210
|
+
/* c8 ignore next 1 - intermittent branch coverage: error instanceof Error false branch */
|
|
176
211
|
const message = error instanceof Error ? error.message : String(error);
|
|
177
212
|
return fail(`Failed to create FileSystemAccessTreeAccessors from file: ${message}`);
|
|
178
213
|
}
|
|
@@ -294,6 +329,14 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
294
329
|
|
|
295
330
|
const errors: string[] = [];
|
|
296
331
|
|
|
332
|
+
// Process pending deletions from disk
|
|
333
|
+
for (const path of this._pendingDeletions) {
|
|
334
|
+
const deleteResult = await this._deleteFileFromDisk(path);
|
|
335
|
+
if (deleteResult.isFailure()) {
|
|
336
|
+
errors.push(`delete ${path}: ${deleteResult.message}`);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
297
340
|
for (const path of this._dirtyFiles) {
|
|
298
341
|
const syncResult = await this._syncFile(path);
|
|
299
342
|
if (syncResult.isFailure()) {
|
|
@@ -305,6 +348,7 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
305
348
|
return fail(`Failed to sync ${errors.length} file(s):\n${errors.join('\n')}`);
|
|
306
349
|
}
|
|
307
350
|
|
|
351
|
+
this._pendingDeletions.clear();
|
|
308
352
|
this._dirtyFiles.clear();
|
|
309
353
|
return succeed(undefined);
|
|
310
354
|
}
|
|
@@ -313,14 +357,34 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
313
357
|
* Implements `FileTree.IPersistentFileTreeAccessors.isDirty`
|
|
314
358
|
*/
|
|
315
359
|
public isDirty(): boolean {
|
|
316
|
-
return this._dirtyFiles.size > 0;
|
|
360
|
+
return this._dirtyFiles.size > 0 || this._pendingDeletions.size > 0;
|
|
317
361
|
}
|
|
318
362
|
|
|
319
363
|
/**
|
|
320
364
|
* Implements `FileTree.IPersistentFileTreeAccessors.getDirtyPaths`
|
|
321
365
|
*/
|
|
322
366
|
public getDirtyPaths(): string[] {
|
|
323
|
-
return Array.from(this._dirtyFiles);
|
|
367
|
+
return [...Array.from(this._dirtyFiles), ...Array.from(this._pendingDeletions)];
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
/**
|
|
371
|
+
* Override deleteFile to track pending deletions for syncToDisk.
|
|
372
|
+
*/
|
|
373
|
+
public deleteFile(path: string): Result<boolean> {
|
|
374
|
+
const result = super.deleteFile(path);
|
|
375
|
+
if (result.isSuccess()) {
|
|
376
|
+
this._dirtyFiles.delete(path);
|
|
377
|
+
this._handles.delete(path);
|
|
378
|
+
|
|
379
|
+
if (this._hasWritePermission) {
|
|
380
|
+
this._pendingDeletions.add(path);
|
|
381
|
+
|
|
382
|
+
if (this._autoSync) {
|
|
383
|
+
void this._runAutoSyncTask(path, 'delete', () => this._deleteFileFromDisk(path));
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
return result;
|
|
324
388
|
}
|
|
325
389
|
|
|
326
390
|
/**
|
|
@@ -335,11 +399,8 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
335
399
|
|
|
336
400
|
// Auto-sync if enabled
|
|
337
401
|
if (this._autoSync) {
|
|
338
|
-
// Fire and
|
|
339
|
-
this.
|
|
340
|
-
/* c8 ignore next 1 - defensive: async auto-sync error logging */
|
|
341
|
-
console.error(`Auto-sync failed for ${path}:`, err);
|
|
342
|
-
});
|
|
402
|
+
// Fire and log-on-failure; don't block the save path.
|
|
403
|
+
void this._runAutoSyncTask(path, 'save', () => this._syncFile(path));
|
|
343
404
|
}
|
|
344
405
|
}
|
|
345
406
|
|
|
@@ -389,6 +450,37 @@ export class FileSystemAccessTreeAccessors<TCT extends string = string>
|
|
|
389
450
|
}
|
|
390
451
|
}
|
|
391
452
|
|
|
453
|
+
/**
|
|
454
|
+
* Delete a file from disk using the File System Access API.
|
|
455
|
+
* @param path - The path of the file to delete.
|
|
456
|
+
* @returns Promise resolving to success or failure.
|
|
457
|
+
* @internal
|
|
458
|
+
*/
|
|
459
|
+
private async _deleteFileFromDisk(path: string): Promise<Result<void>> {
|
|
460
|
+
try {
|
|
461
|
+
const absolutePath = this.resolveAbsolutePath(path);
|
|
462
|
+
const parts = absolutePath.split('/').filter((p) => p.length > 0);
|
|
463
|
+
const filename = parts.pop();
|
|
464
|
+
|
|
465
|
+
/* c8 ignore next 3 - defensive: invalid path */
|
|
466
|
+
if (!filename) {
|
|
467
|
+
return fail(`Invalid file path: ${path}`);
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
// Navigate to the parent directory
|
|
471
|
+
let currentDir = this._rootDir;
|
|
472
|
+
for (const part of parts) {
|
|
473
|
+
currentDir = await currentDir.getDirectoryHandle(part);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
await currentDir.removeEntry(filename);
|
|
477
|
+
return succeed(undefined);
|
|
478
|
+
} catch (error) {
|
|
479
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
480
|
+
return fail(`Failed to delete file ${path}: ${message}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
392
484
|
/**
|
|
393
485
|
* Create a new file and write its contents.
|
|
394
486
|
* @param path - The path of the file to create.
|