From 51171377e2cc7f313e0d070a660bedb7947f0e0d Mon Sep 17 00:00:00 2001 From: vsyroc Date: Thu, 10 Jul 2025 18:52:11 +0500 Subject: [PATCH] feat(client): add edge name generator --- client/src/utils/edge.ts | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 client/src/utils/edge.ts diff --git a/client/src/utils/edge.ts b/client/src/utils/edge.ts new file mode 100644 index 0000000..766e673 --- /dev/null +++ b/client/src/utils/edge.ts @@ -0,0 +1,8 @@ +function edgeTitleGenerator(counter: number) { + const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + const num = Math.ceil(counter / chars.length); + const letterIndex = (counter - 1) % chars.length; + return `${chars[letterIndex]}${num}`; +} + +export { edgeTitleGenerator };