MCPcopy Create free account
hub / github.com/TruthHun/BookStack / JSZip

Function JSZip

static/word2md/mammoth.browser.js:12529–12556  ·  view source on GitHub ↗

* Representation a of zip file in js * @constructor * @param {String=|ArrayBuffer=|Uint8Array=} data the data to load, if any (optional). * @param {Object=} options the options for creating this objects (optional).

(data, options)

Source from the content-addressed store, hash-verified

12527 * @param {Object=} options the options for creating this objects (optional).
12528 */
12529function JSZip(data, options) {
12530 // if this constructor is used without `new`, it adds `new` before itself:
12531 if(!(this instanceof JSZip)) return new JSZip(data, options);
12532
12533 // object containing the files :
12534 // {
12535 // "folder/" : {...},
12536 // "folder/data.txt" : {...}
12537 // }
12538 this.files = {};
12539
12540 this.comment = null;
12541
12542 // Where we are in the hierarchy
12543 this.root = "";
12544 if (data) {
12545 this.load(data, options);
12546 }
12547 this.clone = function() {
12548 var newObj = new JSZip();
12549 for (var i in this) {
12550 if (typeof this[i] !== "function") {
12551 newObj[i] = this[i];
12552 }
12553 }
12554 return newObj;
12555 };
12556}
12557JSZip.prototype = require('./object');
12558JSZip.prototype.load = require('./load');
12559JSZip.support = require('./support');

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected