JS 浅拷贝对象(去除function类型的数据)
/**
* 浅拷贝对象(去除function类型的数据)
*
* @param {*} target
* @returns
*/
export const copyObject = (target) => {
try {
return { ...JSON.parse(JSON.stringify(target)) }
} catch (error) {
// console.log('error: ', error)
}
return {}
}