@indielayer/ui
Version:
Indielayer UI Components with Tailwind CSS build for Vue 3
26 lines (25 loc) • 809 B
JavaScript
import { isRef as o, unref as f } from "vue";
const s = (n) => n !== null && typeof n == "object", p = (n) => Array.isArray(n), h = (n) => typeof n == "function", b = (n) => {
const e = o(n) ? f(n) : n;
return s(e) ? p(e) ? j(e) : m(e) : e;
}, i = (n) => n !== null && !o(n) && typeof n == "object" ? b(n) : f(n), j = (n) => n.map(i), m = (n) => {
const e = {};
return Object.keys(n).forEach((t) => {
e[t] = i(n[t]);
}), e;
}, d = (n = {}, e = {}) => {
const t = Object.keys(n), u = Object.keys(e), c = { ...n };
return u.forEach((r) => {
t.includes(r) && s(n[r]) && s(e[r]) ? c[r] = d(n[r], e[r]) : c[r] = e[r];
}), c;
};
export {
b as deepUnref,
p as isArray,
h as isFunction,
s as isObject,
d as mergeRightDeep,
i as smartUnref,
j as unrefArray,
m as unrefObject
};