src/sap.ui.core/src/sap/ui/thirdparty/jszip.js
function(name, data, o) {
        if (arguments.length === 1) {
            if (utils.isRegExp(name)) {
                var regexp = name;
                return this.filter(function(relativePath, file) {
                    return !file.options.dir && regexp.test(relativePath);
                });
            }
            else { // text
                return this.filter(function(relativePath, file) {
                    return !file.options.dir && relativePath === name;
                })[0] || null;
            }
        }
        else { // more than one argument : we have data !
            name = this.root + name;
            fileAdd.call(this, name, data, o);
        }
        return this;
    }
function(name, data, o) {
        if (arguments.length === 1) {
            if (utils.isRegExp(name)) {
                var regexp = name;
                return this.filter(function(relativePath, file) {
                    return !file.options.dir && regexp.test(relativePath);
                });
            }
            else { // text
                return this.filter(function(relativePath, file) {
                    return !file.options.dir && relativePath === name;
                })[0] || null;
            }
        }
        else { // more than one argument : we have data !
            name = this.root + name;
            fileAdd.call(this, name, data, o);
        }
        return this;
    }
function ( name , data , o ) { if ( arguments . length === 1 ) { if ( utils . isRegExp ( name ) ) { var regexp = name ; return this . filter ( function ( relativePath , file ) { return ! file . options . dir && regexp . test ( relativePath ) ; } ) ; } else { // text return this . filter ( function ( relativePath , file ) { return ! file . options . dir && relativePath === name ; } ) [ 0 ] || null ; } } else { // more than one argument : we have data ! name = this . root + name ; fileAdd . call ( this , name , data , o ) ; } return this ; }
Add a file to the zip file, or search a file.
@param   {string|RegExp} name The name of the file to add (if data is defined),
the name of the file to find (if no data) or a regex to match files.
@param   {String|ArrayBuffer|Uint8Array|Buffer} data  The file data, either raw or base64 encoded
@param   {Object} o     File options
@return  {JSZip|Object|Array} this JSZip object (when adding a file),
a file (when searching by string) or an array of files (when searching by regex).
Add a file to the zip file or search a file .