lib/irc: add formatURL
This commit is contained in:
11
lib/irc.js
11
lib/irc.js
@@ -839,6 +839,17 @@ export function parseURL(str) {
|
||||
return { host, enttype, entity };
|
||||
}
|
||||
|
||||
export function formatURL({ host, enttype, entity } = {}) {
|
||||
host = host || "";
|
||||
entity = entity || "";
|
||||
|
||||
let s = "irc://" + host + "/" + encodeURIComponent(entity);
|
||||
if (enttype) {
|
||||
s += ",is" + enttype;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
export class CapRegistry {
|
||||
available = new Map();
|
||||
enabled = new Set();
|
||||
|
||||
Reference in New Issue
Block a user