@stanfordspezi/spezi-web-design-system
Version:
Stanford Biodesign Digital Health Spezi Web Design System
36 lines (35 loc) • 1.23 kB
JavaScript
import { t as l } from "./Toaster-BOgUkztH.mjs";
import { i as p } from "./isString-CmHDXlmA.mjs";
import { i as r } from "./isNil-CjWwlQS3.mjs";
const b = (t) => !t, d = async (t) => {
try {
await navigator.clipboard.writeText(t), l("Copied to clipboard");
} catch {
console.info("Copying failed");
}
}, y = (t) => `${t.slice(0, 1).toUpperCase()}${t.slice(1)}`, j = (t, i) => new Array(t).fill(void 0).map((n, s) => i(s)), w = (t, i) => t[i], C = (t) => p(t) ? t : void 0, f = (t) => t !== null && typeof t == "object", T = (t) => {
if (t === "" || r(t)) return !0;
const i = f(t);
return i && "length" in t ? t.length === 0 : i && "size" in t ? t.size === 0 : i ? Object.entries(t).length === 0 : !1;
}, g = (t) => t ? "true" : "false", z = (t) => r(t) ? null : g(t), O = (...t) => {
const i = t.filter(
(n) => !r(n) && String(n).length > 0
).map(String).map((n, s, e) => {
const a = s === 0, c = s === e.length - 1, o = a ? n : n.replace(/^\/+/, "");
return c ? o : o.replace(/\/+$/, "");
}).filter((n) => n.length > 0);
return i.length === 0 ? "" : i.join("/");
};
export {
z as a,
f as b,
d as c,
C as e,
g as f,
T as i,
O as j,
b as n,
w as s,
j as t,
y as u
};