at path:
ROOT
/
sistema
/
vendors
/
jszip
/
lib
/
zipObject.js
run:
R
W
Run
generate
DIR
2026-04-09 04:12:40
R
W
Run
nodejs
DIR
2026-04-09 04:12:40
R
W
Run
reader
DIR
2026-04-09 04:12:40
R
W
Run
stream
DIR
2026-04-09 04:12:40
R
W
Run
base64.js
3.31 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
compressedObject.js
2.84 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
compressions.js
368 By
2018-11-08 02:46:18
R
W
Run
Delete
Rename
crc32.js
1.88 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
defaults.js
284 By
2018-11-08 02:46:18
R
W
Run
Delete
Rename
external.js
459 By
2018-11-08 02:46:18
R
W
Run
Delete
Rename
flate.js
2.31 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
index.js
1.32 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
license_header.js
392 By
2018-11-08 02:46:18
R
W
Run
Delete
Rename
load.js
2.76 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
nodejsUtils.js
1.75 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
object.js
12.23 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
readable-stream-browser.js
427 By
2018-11-08 02:46:18
R
W
Run
Delete
Rename
signature.js
294 By
2018-11-08 02:46:18
R
W
Run
Delete
Rename
support.js
1.06 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
utf8.js
7.92 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
utils.js
15.31 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
zipEntries.js
11.62 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
zipEntry.js
11 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
zipObject.js
4.42 KB
2018-11-08 02:46:18
R
W
Run
Delete
Rename
error_log
up
📄
zipObject.js
Save
'use strict'; var StreamHelper = require('./stream/StreamHelper'); var DataWorker = require('./stream/DataWorker'); var utf8 = require('./utf8'); var CompressedObject = require('./compressedObject'); var GenericWorker = require('./stream/GenericWorker'); /** * A simple object representing a file in the zip file. * @constructor * @param {string} name the name of the file * @param {String|ArrayBuffer|Uint8Array|Buffer} data the data * @param {Object} options the options of the file */ var ZipObject = function(name, data, options) { this.name = name; this.dir = options.dir; this.date = options.date; this.comment = options.comment; this.unixPermissions = options.unixPermissions; this.dosPermissions = options.dosPermissions; this._data = data; this._dataBinary = options.binary; // keep only the compression this.options = { compression : options.compression, compressionOptions : options.compressionOptions }; }; ZipObject.prototype = { /** * Create an internal stream for the content of this object. * @param {String} type the type of each chunk. * @return StreamHelper the stream. */ internalStream: function (type) { var result = null, outputType = "string"; try { if (!type) { throw new Error("No output type specified."); } outputType = type.toLowerCase(); var askUnicodeString = outputType === "string" || outputType === "text"; if (outputType === "binarystring" || outputType === "text") { outputType = "string"; } result = this._decompressWorker(); var isUnicodeString = !this._dataBinary; if (isUnicodeString && !askUnicodeString) { result = result.pipe(new utf8.Utf8EncodeWorker()); } if (!isUnicodeString && askUnicodeString) { result = result.pipe(new utf8.Utf8DecodeWorker()); } } catch (e) { result = new GenericWorker("error"); result.error(e); } return new StreamHelper(result, outputType, ""); }, /** * Prepare the content in the asked type. * @param {String} type the type of the result. * @param {Function} onUpdate a function to call on each internal update. * @return Promise the promise of the result. */ async: function (type, onUpdate) { return this.internalStream(type).accumulate(onUpdate); }, /** * Prepare the content as a nodejs stream. * @param {String} type the type of each chunk. * @param {Function} onUpdate a function to call on each internal update. * @return Stream the stream. */ nodeStream: function (type, onUpdate) { return this.internalStream(type || "nodebuffer").toNodejsStream(onUpdate); }, /** * Return a worker for the compressed content. * @private * @param {Object} compression the compression object to use. * @param {Object} compressionOptions the options to use when compressing. * @return Worker the worker. */ _compressWorker: function (compression, compressionOptions) { if ( this._data instanceof CompressedObject && this._data.compression.magic === compression.magic ) { return this._data.getCompressedWorker(); } else { var result = this._decompressWorker(); if(!this._dataBinary) { result = result.pipe(new utf8.Utf8EncodeWorker()); } return CompressedObject.createWorkerFrom(result, compression, compressionOptions); } }, /** * Return a worker for the decompressed content. * @private * @return Worker the worker. */ _decompressWorker : function () { if (this._data instanceof CompressedObject) { return this._data.getContentWorker(); } else if (this._data instanceof GenericWorker) { return this._data; } else { return new DataWorker(this._data); } } }; var removedMethods = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"]; var removedFn = function () { throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide."); }; for(var i = 0; i < removedMethods.length; i++) { ZipObject.prototype[removedMethods[i]] = removedFn; } module.exports = ZipObject;