@liveblocks/react-ui
Version:
A set of React pre-built components for the Liveblocks products. Liveblocks is the all-in-one toolkit to build collaborative products like Figma, Notion, and more.
21 lines (19 loc) • 640 B
JavaScript
function isCommentBodyText(element) {
return !("type" in element) && "text" in element && typeof element.text === "string";
}
function isCommentBodyMention(element) {
return "type" in element && element.type === "mention";
}
function isCommentBodyLink(element) {
return "type" in element && element.type === "link";
}
function toAbsoluteUrl(url) {
if (url.startsWith("http://") || url.startsWith("https://")) {
return url;
} else if (url.startsWith("www.")) {
return "https://" + url;
}
return;
}
export { isCommentBodyLink, isCommentBodyMention, isCommentBodyText, toAbsoluteUrl };
//# sourceMappingURL=utils.js.map