aboutsummaryrefslogtreecommitdiffstats
path: root/packages/shared/utils
diff options
context:
space:
mode:
authorMostafa Wahied <97263286+Mostafa-Wahied@users.noreply.github.com>2025-06-22 11:47:51 -0700
committerGitHub <noreply@github.com>2025-06-22 19:47:51 +0100
commit112aa9d942ef0f8548c3728e6218c27cc335a601 (patch)
tree9b0c545fb5b16604e9061e59ebd3d57d7033b4a7 /packages/shared/utils
parentc70d64d4cde2bf2acc5c4164eef79c40fd58aa42 (diff)
downloadkarakeep-112aa9d942ef0f8548c3728e6218c27cc335a601.tar.zst
fix(tags): normalise leading hashes in tag names (#1317) (#1351)
* fix(tags): normalise leading hashes in tag names (#1317) * move the transformation to zod * fix openapi spec --------- Co-authored-by: Mohamed Bassem <me@mbassem.com>
Diffstat (limited to 'packages/shared/utils')
-rw-r--r--packages/shared/utils/tag.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/packages/shared/utils/tag.ts b/packages/shared/utils/tag.ts
new file mode 100644
index 00000000..8e1bd105
--- /dev/null
+++ b/packages/shared/utils/tag.ts
@@ -0,0 +1,6 @@
+/**
+ * Ensures exactly ONE leading #
+ */
+export function normalizeTagName(raw: string): string {
+ return raw.trim().replace(/^#+/, ""); // strip every leading #
+}