Explorar o código

Start giving it more power

Manav Rathi hai 1 ano
pai
achega
38db03c3a0
Modificáronse 1 ficheiros con 13 adicións e 1 borrados
  1. 13 1
      web/apps/photos/src/utils/native-fs.ts

+ 13 - 1
web/apps/photos/src/utils/native-fs.ts

@@ -1,3 +1,11 @@
+/**
+ * @file Native filesystem access using custom Node.js functionality provided by
+ * our desktop app.
+ *
+ * Precondition: Unless mentioned otherwise, the functions in these file only
+ * work when we are running in our desktop app.
+ */
+
 import { ensureElectron } from "@/next/electron";
 import { ensureElectron } from "@/next/electron";
 import { nameAndExtension } from "@/next/file";
 import { nameAndExtension } from "@/next/file";
 import sanitize from "sanitize-filename";
 import sanitize from "sanitize-filename";
@@ -69,4 +77,8 @@ export const safeFileName = async (directoryPath: string, name: string) => {
     return result;
     return result;
 };
 };
 
 
-const exists = (path: string) => ensureElectron().fs.exists(path);
+/**
+ * Return true if an item exists an the given {@link path} on the user's local
+ * filesystem.
+ */
+export const exists = (path: string) => ensureElectron().fs.exists(path);