1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2024-10-01 21:01:58 +02:00
ntfy/web/src/app/utils.js

7 lines
375 B
JavaScript
Raw Normal View History

2022-02-18 20:41:01 +01:00
export const topicUrl = (baseUrl, topic) => `${baseUrl}/${topic}`;
export const topicUrlWs = (baseUrl, topic) => `${topicUrl(baseUrl, topic)}/ws`
.replaceAll("https://", "wss://")
.replaceAll("http://", "ws://");
export const shortUrl = (url) => url.replaceAll(/https?:\/\//g, "");
export const shortTopicUrl = (baseUrl, topic) => shortUrl(topicUrl(baseUrl, topic));