A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
common: remove total-notes utility
Abdullah Attadf9fb59f4064
diff --git a/packages/common/package-lock.json b/packages/common/package-lock.jsonindex 5dead0151..2afacd073 100644--- a/packages/common/package-lock.json+++ b/packages/common/package-lock.json@@ -29,6 +29,7 @@"hasInstallScript": true,"license": "GPL-3.0-or-later","dependencies": {+ "@leeoniya/ufuzzy": "^1.0.10","@microsoft/signalr": "^8.0.0","@notesnook/logger": "file:../logger","@readme/data-urls": "^3.0.0",@@ -39,6 +40,7 @@"html-to-text": "^9.0.5","htmlparser2": "^8.0.1","katex": "0.16.2",+ "kysely": "^0.26.3","linkedom": "^0.14.17","liqe": "^1.13.0","mime-db": "1.52.0",@@ -49,6 +51,7 @@},"devDependencies": {"@notesnook/crypto": "file:../crypto",+ "@types/better-sqlite3": "^7.6.5","@types/event-source-polyfill": "^1.0.1","@types/html-to-text": "^9.0.0","@types/katex": "^0.16.2",@@ -59,6 +62,8 @@"@types/ws": "^8.5.5","@vitest/coverage-v8": "^0.34.1","abortcontroller-polyfill": "^1.7.3",+ "better-sqlite3": "^8.6.0",+ "bson-objectid": "^2.0.4","cross-env": "^7.0.3","dotenv": "^16.0.1","event-source-polyfill": "^1.0.31",@@ -67,6 +72,7 @@"isomorphic-fetch": "^3.0.0","jsdom": "^22.1.0","mockdate": "^3.0.5",+ "nanoid": "^5.0.1","otplib": "^12.0.1","refractor": "^4.8.1","vitest": "^0.34.1",@@ -150,11 +156,13 @@"@notesnook/core": {"version": "file:../core","requires": {+ "@leeoniya/ufuzzy": "^1.0.10","@microsoft/signalr": "^8.0.0","@notesnook/crypto": "file:../crypto","@notesnook/logger": "file:../logger","@readme/data-urls": "^3.0.0","@streetwriters/showdown": "^3.0.5-alpha",+ "@types/better-sqlite3": "^7.6.5","@types/event-source-polyfill": "^1.0.1","@types/html-to-text": "^9.0.0","@types/katex": "^0.16.2",@@ -166,6 +174,8 @@"@vitest/coverage-v8": "^0.34.1","abortcontroller-polyfill": "^1.7.3","async-mutex": "^0.3.2",+ "better-sqlite3": "^8.6.0",+ "bson-objectid": "^2.0.4","cross-env": "^7.0.3","dayjs": "1.11.9","dotenv": "^16.0.1",@@ -178,10 +188,12 @@"isomorphic-fetch": "^3.0.0","jsdom": "^22.1.0","katex": "0.16.2",+ "kysely": "^0.26.3","linkedom": "^0.14.17","liqe": "^1.13.0","mime-db": "1.52.0","mockdate": "^3.0.5",+ "nanoid": "^5.0.1","otplib": "^12.0.1","prismjs": "^1.29.0","qclone": "^1.2.0",diff --git a/packages/common/src/utils/index.ts b/packages/common/src/utils/index.tsindex d2a7cd928..83e7c1793 100644--- a/packages/common/src/utils/index.ts+++ b/packages/common/src/utils/index.ts@@ -19,7 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.export * from "./file";export * from "./number";-export * from "./total-notes";export * from "./time";export * from "./debounce";export * from "./random";diff --git a/packages/common/src/utils/total-notes.ts b/packages/common/src/utils/total-notes.tsdeleted file mode 100644index b4db3330f..000000000--- a/packages/common/src/utils/total-notes.ts+++ /dev/null@@ -1,31 +0,0 @@-/*-This file is part of the Notesnook project (https://notesnook.com/)--Copyright (C) 2023 Streetwriters (Private) Limited--This program is free software: you can redistribute it and/or modify-it under the terms of the GNU General Public License as published by-the Free Software Foundation, either version 3 of the License, or-(at your option) any later version.--This program is distributed in the hope that it will be useful,-but WITHOUT ANY WARRANTY; without even the implied warranty of-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the-GNU General Public License for more details.--You should have received a copy of the GNU General Public License-along with this program. If not, see <http://www.gnu.org/licenses/>.-*/-import { Item } from "@notesnook/core/dist/types";-import { database } from "../database";--export function getTotalNotes(item?: Item) {- if (!item || (item.type !== "notebook" && item.type !== "topic")) return 0;- if (item.type === "topic") {- return (- database.notebooks?.notebook(item.notebookId)?.topics.topic(item.id)- ?.totalNotes || 0- );- }- return database.notebooks?.notebook(item.id)?.totalNotes || 0;-}