1 line
6.6 KiB
JSON
1 line
6.6 KiB
JSON
|
{"ast":null,"code":"import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar traverseFileTree = function traverseFileTree(files, callback, isAccepted) {\n var flattenFileList = [];\n var progressFileList = [];\n files.forEach(function (file) {\n return progressFileList.push(file.webkitGetAsEntry());\n });\n function loopFiles(item) {\n var dirReader = item.createReader();\n function sequence() {\n dirReader.readEntries(function (entries) {\n var entryList = Array.prototype.slice.apply(entries);\n progressFileList.push.apply(progressFileList, _toConsumableArray(entryList));\n // Check if all the file has been viewed\n var isFinished = !entryList.length;\n if (!isFinished) {\n sequence();\n }\n });\n }\n sequence();\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n var _traverseFileTree = function _traverseFileTree(item, path) {\n if (!item) {\n return;\n }\n // eslint-disable-next-line no-param-reassign\n item.path = path || '';\n if (item.isFile) {\n item.file(function (file) {\n if (isAccepted(file)) {\n // https://github.com/ant-design/ant-design/issues/16426\n if (item.fullPath && !file.webkitRelativePath) {\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: true\n }\n });\n // eslint-disable-next-line no-param-reassign\n file.webkitRelativePath = item.fullPath.replace(/^\\//, '');\n Object.defineProperties(file, {\n webkitRelativePath: {\n writable: false\n }\n });\n }\n flattenFileList.push(file);\n }\n });\n } else if (item.isDirectory) {\n loopFiles(item);\n }\n };\n function walkFiles() {\n var wipIndex = 0;\n while (wipIndex < progressFileList.length) {\n _traverseFileTree(progressFileList[wipIndex]);\n wipIndex++;\n }\n callback(flattenFileList);\n }\n walkFiles();\n};\nexport default traverseFileTree;","map":{"version":3,"names":["_toConsumableArray","traverseFileTree","files","callback","isAccepted","flattenFileList","progressFileList","forEach","file","push","webkitGetAsEntry","loopFiles","item","dirReader","createReader","sequence","readEntries","entries","entryList","Array","prototype","slice","apply","isFinished","length","_traverseFileTree","path","isFile","fullPath","webkitRelativePath","Object","defineProperties","writable","replace","isDirectory","walkFiles","wipIndex"],"sources":["C:/Users/Аришина)/Desktop/promo/node_modules/rc-upload/es/traverseFileTree.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar traverseFileTree = function traverseFileTree(files, callback, isAccepted) {\n var flattenFileList = [];\n var progressFileList = [];\n files.forEach(function (file) {\n return progressFileList.push(file.webkitGetAsEntry());\n });\n function loopFiles(item) {\n var dirReader = item.createReader();\n function sequence() {\n dirReader.readEntries(function (entries) {\n var entryList = Array.prototype.slice.apply(entries);\n progressFileList.push.apply(progressFileList, _toConsumableArray(entryList));\n // Check if all the file has been viewed\n var isFinished = !entryList.length;\n if (!isFinished) {\n sequence();\n }\n });\n }\n sequence();\n }\n // eslint-disable-next-line @typescript-eslint/naming-convention\n var _traverseFileTree = function _traverseFileTree(item, path) {\n if (!item) {\n return;\n }\n // eslint-disable-next-line no-param-reassign\n item.path = path || '';\n if (item.isFile) {\n item.file(function (file) {\n if (isAccepted(file)) {\n // https://github.com/ant-design/ant-design/issues/16426\n if (item.fullPath && !file.webkitRelativePath) {\n Object.definePropert
|