st-common-core
Version:
小尾巴前端通用核心库
24 lines (23 loc) • 507 B
JavaScript
const c = ({
obj: t,
props: i = [],
excludeProps: e = []
}) => {
const s = {};
for (const n in t)
e.length > 0 && e.includes(n) || i.length > 0 && !i.includes(n) || (s[n] = JSON.stringify(t[n]));
return s;
}, o = ({
obj: t,
props: i = [],
excludeProps: e = []
}) => {
const s = {};
for (const n in t)
e.length > 0 && e.includes(n) || i.length > 0 && !i.includes(n) || (s[n] = JSON.parse(t[n]));
return s;
};
export {
o as jsonParseObjProps,
c as jsonStringifyObjProps
};