mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-16 01:41:02 +08:00
11 lines
287 B
TypeScript
11 lines
287 B
TypeScript
export default function getFileItem(file, fileList) {
|
|
let matchWay = (!file.uid) ? 'byName' : 'byUid';
|
|
let target = fileList.filter((item) => {
|
|
if (matchWay === 'byName') {
|
|
return item.name === file.name;
|
|
}
|
|
return item.uid === file.uid;
|
|
})[0];
|
|
return target;
|
|
}
|