@tencentcloud/roomkit-web-vue3
Version:
<h1 align="center"> TUIRoomKit</h1> Conference (TUIRoomKit) is a product suitable for multi-person audio and video conversation scenarios such as business meetings, webinars, and online education. By integrating this product, you can add room management,
26 lines (25 loc) • 804 B
JavaScript
import { getUrlParam } from "./utils.mjs";
const THEME = {
LIGHT: "light",
DARK: "dark"
};
function getLanguage() {
const isWxMiniProgram = typeof wx !== "undefined" && wx.getSystemInfoSync;
let language = getUrlParam("lang") || navigator.language || (isWxMiniProgram ? "zh-CN" : "en-US");
language = language.replace(/_/, "-").toLowerCase();
const isZh = language.startsWith("zh");
language = isZh ? "zh-CN" : "en-US";
return language;
}
function toTargetTheme(themeOption) {
const theme = themeOption === "DARK" ? THEME.DARK : THEME.LIGHT;
return theme;
}
const invalidDigitalPasswordRegex = /[^\d]+/g;
const invalidPasswordRegex = /[^A-Za-z0-9!@#$%^&*()_+{}|:"<>?`~';[\]\\/.,-=]+/g;
export {
getLanguage,
invalidDigitalPasswordRegex,
invalidPasswordRegex,
toTargetTheme
};