Bläddra i källkod

Fix typos and get fn back to a reasonable size

Gabriel Horner 2 år sedan
förälder
incheckning
ef03f12da7

+ 10 - 7
deps/graph-parser/src/logseq/graph_parser/test/docs_graph_helper.cljs

@@ -68,6 +68,15 @@
             db)
        ffirst))
 
+(defn- get-counts-for-common-attributes [db]
+  (->> [:block/scheduled :block/priority :block/deadline :block/collapsed?
+        :block/repeated?]
+       (map (fn [attr]
+              [attr
+               (ffirst (d/q [:find (list 'count '?b) :where ['?b attr]]
+                            db))]))
+       (into {})))
+
 (defn- query-assertions
   [db graph-dir files]
   (testing "Query based stats"
@@ -121,13 +130,7 @@
             :block/deadline 1
             :block/collapsed? 80
             :block/repeated? 1}
-           (->> [:block/scheduled :block/priority :block/deadline :block/collapsed?
-                 :block/repeated?]
-                (map (fn [attr]
-                       [attr
-                        (ffirst (d/q [:find (list 'count '?b) :where ['?b attr]]
-                                     db))]))
-                (into {})))
+           (get-counts-for-common-attributes db))
         "Counts for blocks with common block attributes")
 
     (let [no-name (->> (d/q '[:find (pull ?n [*]) :where [?b :block/namespace ?n]] db)

+ 1 - 2
deps/persist-db/src/index.js

@@ -233,7 +233,7 @@ const SQLiteDB = {
     },
 
     async fetchAllPages(dbName) {
-        console.log("featch all pages");
+        console.log("fetch all pages");
         let db = dbMap[dbName];
         if (!db) {
             await this.newDB(dbName);
@@ -369,4 +369,3 @@ onconnect = function (event) {
     const port = event.ports[0];
     Comlink.expose(SQLiteDB, port);
 };
-

+ 1 - 0
typos.toml

@@ -12,5 +12,6 @@ BA = "BA"
 fo = "fo"
 aks = "aks"
 Mannor = "Mannor"
+nd = "nd"
 [files]
 extend-exclude = ["resources/*", "src/resources/*"]