{“ast”:null,“code”:“'use strict';nnvar StreamHelper = require('./stream/StreamHelper');nnvar DataWorker = require('./stream/DataWorker');nnvar utf8 = require('./utf8');nnvar CompressedObject = require('./compressedObject');nnvar GenericWorker = require('./stream/GenericWorker');n/**n * A simple object representing a file in the zip file.n * @constructorn * @param {string} name the name of the filen * @param {String|ArrayBuffer|Uint8Array|Buffer} data the datan * @param {Object} options the options of the filen */nnnvar ZipObject = function ZipObject(name, data, options) {n this.name = name;n this.dir = options.dir;n this.date = options.date;n this.comment = options.comment;n this.unixPermissions = options.unixPermissions;n this.dosPermissions = options.dosPermissions;n this._data = data;n this._dataBinary = options.binary; // keep only the compressionnn this.options = {n compression: options.compression,n compressionOptions: options.compressionOptionsn };n};nnZipObject.prototype = {n /**n * Create an internal stream for the content of this object.n * @param {String} type the type of each chunk.n * @return StreamHelper the stream.n */n internalStream: function internalStream(type) {n var result = null,n outputType = "string";nn try {n if (!type) {n throw new Error("No output type specified.");n }nn outputType = type.toLowerCase();n var askUnicodeString = outputType === "string" || outputType === "text";nn if (outputType === "binarystring" || outputType === "text") {n outputType = "string";n }nn result = this._decompressWorker();n var isUnicodeString = !this._dataBinary;nn if (isUnicodeString && !askUnicodeString) {n result = result.pipe(new utf8.Utf8EncodeWorker());n }nn if (!isUnicodeString && askUnicodeString) {n result = result.pipe(new utf8.Utf8DecodeWorker());n }n } catch (e) {n result = new GenericWorker("error");n result.error(e);n }nn return new StreamHelper(result, outputType, "");n },nn /**n * Prepare the content in the asked type.n * @param {String} type the type of the result.n * @param {Function} onUpdate a function to call on each internal update.n * @return Promise the promise of the result.n */n async: function async(type, onUpdate) {n return this.internalStream(type).accumulate(onUpdate);n },nn /**n * Prepare the content as a nodejs stream.n * @param {String} type the type of each chunk.n * @param {Function} onUpdate a function to call on each internal update.n * @return Stream the stream.n */n nodeStream: function nodeStream(type, onUpdate) {n return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate);n },nn /**n * Return a worker for the compressed content.n * @privaten * @param {Object} compression the compression object to use.n * @param {Object} compressionOptions the options to use when compressing.n * @return Worker the worker.n */n _compressWorker: function _compressWorker(compression, compressionOptions) {n if (this._data instanceof CompressedObject && this._data.compression.magic === compression.magic) {n return this._data.getCompressedWorker();n } else {n var result = this._decompressWorker();nn if (!this._dataBinary) {n result = result.pipe(new utf8.Utf8EncodeWorker());n }nn return CompressedObject.createWorkerFrom(result, compression, compressionOptions);n }n },nn /**n * Return a worker for the decompressed content.n * @privaten * @return Worker the worker.n */n _decompressWorker: function _decompressWorker() {n if (this._data instanceof CompressedObject) {n return this._data.getContentWorker();n } else if (this._data instanceof GenericWorker) {n return this._data;n } else {n return new DataWorker(this._data);n }n }n};nvar removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"];nnvar removedFn = function removedFn() {n throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");n};nnfor (var i = 0; i < removedMethods.length; i++) {n ZipObject.prototype[removedMethods] = removedFn;n}nnmodule.exports = ZipObject;”,“map”:null,“metadata”:{},“sourceType”:“module”}