UNPKG

d-utils

Version:

d-utils

12 lines (11 loc) 474 B
/** * d-utils version: 4.0.3 * by ifmiss */ "use strict"; /** * @description 文件转成blob流 * @param { File } dataUrl 单个file * @return { Blob } 返回新的文件流 可以append到formdata中 */ function e(e){for(var t=e.split(","),r=t[0].match(/:(.*?);/)[1],o=atob(t[1]),l=o.length,n=new Uint8Array(l);l--;)n[l]=o.charCodeAt(l);return new Blob([n],{type:r})}Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=e,exports.fileToBolb=e;