sliftutils 1.4.0 → 1.4.1
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
|
@@ -396,12 +396,15 @@ export const getFileStorageNested2 = cache(async function getFileStorage(pathStr
|
|
|
396
396
|
} else {
|
|
397
397
|
base = await getDirectoryHandle();
|
|
398
398
|
let dirs: string[] = [];
|
|
399
|
+
let alls: string[] = [];
|
|
399
400
|
for await (const [name, entry] of base) {
|
|
400
401
|
if (entry.kind === "directory") {
|
|
401
402
|
dirs.push(name);
|
|
402
403
|
}
|
|
404
|
+
alls.push(name);
|
|
403
405
|
}
|
|
404
|
-
|
|
406
|
+
// HACK: If there are enough files, it's almost certainly not a directory that contains collections. It's probably the user's data instead
|
|
407
|
+
if (dirs.includes(".git") || dirs.includes("data") || alls.length > 100) {
|
|
405
408
|
base = await base.getDirectoryHandle("data", { create: true });
|
|
406
409
|
}
|
|
407
410
|
}
|