UNPKG

@thewtex/vtk.js-esm

Version:

Visualization Toolkit for the Web

59 lines (49 loc) 1.5 kB
import { o as object } from './object.js'; import { l as load } from './load.js'; import { s as support } from './support.js'; import { d as defaults } from './defaults.js'; import { e as external } from './external.js'; /** * Representation a of zip file in js * @constructor */ function JSZip() { // if this constructor is used without `new`, it adds `new` before itself: if(!(this instanceof JSZip)) { return new JSZip(); } if(arguments.length) { throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide."); } // object containing the files : // { // "folder/" : {...}, // "folder/data.txt" : {...} // } this.files = {}; this.comment = null; // Where we are in the hierarchy this.root = ""; this.clone = function() { var newObj = new JSZip(); for (var i in this) { if (typeof this[i] !== "function") { newObj[i] = this[i]; } } return newObj; }; } JSZip.prototype = object; JSZip.prototype.loadAsync = load; JSZip.support = support; JSZip.defaults = defaults; // TODO find a better way to handle this version, // a require('package.json').version doesn't work with webpack, see #327 JSZip.version = "3.2.0"; JSZip.loadAsync = function (content, options) { return new JSZip().loadAsync(content, options); }; JSZip.external = external; var lib = JSZip; export { lib as l };