FurBall/uni_modules/tuniaoui-vue3/libs/lodash/_copyArray.ts

11 lines
229 B
TypeScript

export function copyArray(source: any, array: any) {
let index = -1
const length = source.length
array || (array = Array.from({ length }))
while (++index < length) {
array[index] = source[index]
}
return array
}