企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
```js export function deepCopy (data) { const type = typeOf(data) let obj if (type === 'array') { obj = [] } else if (type === 'object') { obj = {} } else { return data } if (type === 'array') { for (let i = 0; i < data.length; i++) { obj.push(deepCopy(data[i])) } } else if (type === 'object') { for (const i in data) { obj[i] = deepCopy(data[i]) } } return obj } ```