lm-upload
Version:
* 作者:quying * 邮箱:qy9404@163.com * 版本:**`0.2.0`**
30 lines (25 loc) • 764 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
exports.initFileList = initFileList;
exports.default = uid;
var now = +new Date();
var index = 0;
function initFileList(fileList) {
return fileList.map(function (item) {
if ((typeof item === 'undefined' ? 'undefined' : _typeof(item)) === 'object') {
item.uid = uid();
return item;
} else {
return {
fileURI: item,
uid: uid()
};
}
});
}
function uid() {
return now + '-' + ++index;
}