UNPKG

@jk-core/utils

Version:
33 lines (32 loc) 1.07 kB
function u(t) { return Object.entries(t).filter(([, r]) => r).map(([r]) => r).join(" "); } const o = (t, r = 2) => { if (t == null || Number.isNaN(Number(t))) return 0; const i = `${t}`; if (!i.includes("e")) return +`${Math.round(parseFloat(`${t}e+${r}`))}e-${r}`; const e = i.split("e"); let n = ""; return +e[1] + r > 0 && (n = "+"), +`${Math.round(parseFloat(`${+e[0]}e${n}${+e[1] + r}`))}e-${r}`; }, s = (t, r = 2) => t == null || Number.isNaN(t) ? "-" : o(t, r), c = (t = 0) => { const r = t ?? 0, i = Math.trunc(r) || 0, e = Math.floor((r - i) * 60) || 0; return { fullTime: `${i !== 0 ? `${i}시간` : ""}${e !== 0 ? ` ${e}분` : ""}` || "0분", hour: i, minute: e }; }, a = () => { const { userAgent: t } = navigator; return t.match(/Android/i) || t.match(/iPhone|iPad|iPod/i) ? !0 : !(t.match(/Windows/i) || t.match(/Macintosh/i)); }, d = (t) => t != null; export { a as checkIsMobile, u as cn, s as displayRoundNum, c as formatTime, d as isDefined, o as roundNum }; //# sourceMappingURL=index.js.map