* Apply the final transformation of the data. If the user wants a Blob for * example, it's easier to work with an U8intArray and finally do the * ArrayBuffer/Blob conversion. * @param {String} type the name of the final type * @param {String|Uint8Array|Buffer} content the content to transform *
(type, content, mimeType)
| 2792 | * @return {String|Uint8Array|ArrayBuffer|Buffer|Blob} the content in the right format. |
| 2793 | */ |
| 2794 | function transformZipOutput(type, content, mimeType) { |
| 2795 | switch(type) { |
| 2796 | case "blob" : |
| 2797 | return utils.newBlob(utils.transformTo("arraybuffer", content), mimeType); |
| 2798 | case "base64" : |
| 2799 | return base64.encode(content); |
| 2800 | default : |
| 2801 | return utils.transformTo(type, content); |
| 2802 | } |
| 2803 | } |
| 2804 | |
| 2805 | /** |
| 2806 | * Concatenate an array of data of the given type. |