If I understand correctly, you want to updated checked
to true
if file.length === 0
and false
and file.length !== 0
If that is correct, you can just do:
return Object.assign(file, {
temp_id: _.uniqueId(),
checked: files.length === 0,
})
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…