Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

stream_data: Make slug regex a bit more readable.

evykassirer2ad1dc7014a0
diff --git a/web/src/stream_data.ts b/web/src/stream_data.ts
index 3361ac59fa5..9cdfdd3cfa2 100644
--- a/web/src/stream_data.ts
+++ b/web/src/stream_data.ts
@@ -271,7 +271,7 @@ export function slug_to_stream_id(slug: string): number | undefined {
*/
// "New" (2018) format: ${stream_id}-${stream_name} .
- const match = /^(\d+)(-.*)?$/.exec(slug);
+ const match = /^(\d+)(?:-.*)?$/.exec(slug);
const newFormatStreamId = match ? Number.parseInt(match[1]!, 10) : null;
if (newFormatStreamId && stream_info.get(newFormatStreamId)) {
return newFormatStreamId;