EASYAIuniappNewUI/node_modules/@tuniao/tnui-vue3-uniapp/libs/lodash/_cloneSet.ts
2025-02-08 18:50:38 +08:00

9 lines
342 B
TypeScript

import { addSetEntry } from './_addSetEntry'
import { arrayReduce } from './_arrayReduce'
import { setToArray } from './_setToArray'
export function cloneSet(set: any, isDeep: any, cloneFunc: any) {
const array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set)
return arrayReduce(array, addSetEntry, new set.constructor())
}