sliftutils 0.38.0 → 0.39.0
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/package.json
CHANGED
|
@@ -10,14 +10,17 @@ export class PrivateFileSystemStorage implements IStorageRaw {
|
|
|
10
10
|
if (!navigator.storage?.getDirectory) {
|
|
11
11
|
throw new Error("Private File System Access API not supported in this browser");
|
|
12
12
|
}
|
|
13
|
+
if (location.protocol === "file:") {
|
|
14
|
+
throw new Error(`Private File System API is disallowed in file:// type locations. Either use the File System API (the use gives you access to their file system), or host on an actual domain`);
|
|
15
|
+
}
|
|
13
16
|
this.rootHandle = await navigator.storage.getDirectory();
|
|
14
17
|
}
|
|
15
18
|
return this.rootHandle;
|
|
16
19
|
}
|
|
17
20
|
|
|
18
21
|
private async directoryExists(): Promise<boolean> {
|
|
22
|
+
const root = await this.ensureInitialized();
|
|
19
23
|
try {
|
|
20
|
-
const root = await this.ensureInitialized();
|
|
21
24
|
|
|
22
25
|
if (!this.path || this.path === "" || this.path === "/") {
|
|
23
26
|
return true; // Root always exists
|