ant-design/components/upload/getFileItem.js
afc163 42708fe45d Refractor upload API
1. Remove limit urlResolver and onRemove
2. Remove onSuccess onProgress onError
3. Add onChange
4. Add fileList and defaultFileList props
2015-09-01 00:55:49 +08:00

12 lines
302 B
JavaScript

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;
} else {
return item.uid === file.uid;
}
})[0];
return target;
}