Return an object URL based on the given data.

@param {string|Blob|ArrayBuffer} data

@returns {*}
487887
function getObjectUrl (data) {
  let blob;

  if (typeof data === 'object' && data.constructor.name === 'Blob') {
    blob = data;
  } else if (typeof data === 'string') {
    blob = new Blob([getTextEncoder().encode(data).buffer], {
      type: 'application/octet-stream'
    });
  } else if (typeof data === 'object' && data.constructor && data.constructor.name === 'ArrayBuffer') {
    blob = new Blob([data], {
      type: 'application/octet-stream'
    });
  } else {
    throw new Error('in-browser-download: Data must either be a Blob, a string or an ArrayBuffer');
  }

  return URL.createObjectURL(blob);
}
966118
function (data) {
      var parse = function() {
        var parsed = lazy.extend({}, lazy.parseFilepath(this.path), data);
        if (typeof parsed.ext === 'undefined') {
          parsed.ext = parsed.extname;
        }
        return parsed;
      }.bind(this);
      return this.fragmentCache('path', parse);
    }
91974
function toBase64URL(data) {
    if (typeof data === 'string') {
        data = new Buffer(data);
    }

    return data.toString('base64')
        .replace(/=+/g, '')     // remove '='s
        .replace(/\+/g, '-')    // '+' → '-'
        .replace(/\//g, '_');   // '/' → '_'
}
299698
function getLoader(data) {
	if(typeof Loader !== "undefined" && (data instanceof global.Loader)) {
		return data;
	} else if(typeof LoaderPolyfill !== "undefined" && (data instanceof global.LoaderPolyfill)) {
		return data;
	} else {
		return data.steal.System;
	}
}
406363
function toBuffer(data) {
  toBuffer.readOnly = true;

  if (Buffer.isBuffer(data)) return data;

  let buf;

  if (data instanceof ArrayBuffer) {
    buf = Buffer.from(data);
  } else if (ArrayBuffer.isView(data)) {
    buf = viewToBuffer(data);
  } else {
    buf = Buffer.from(data);
    toBuffer.readOnly = false;
  }

  return buf;
}
1190896
function dataURItoBlob(dataURI) {
  // convert base64/URLEncoded data component to raw binary data held in a string
  var byteString;
  if (dataURI.split(',')[0].indexOf('base64') >= 0)
    byteString = atob(dataURI.split(',')[1]);
  else
    byteString = unescape(dataURI.split(',')[1]);

  // separate out the mime component
  var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0];

  // write the bytes of the string to a typed array
  var ia = new Uint8Array(byteString.length);
  for (var i = 0; i < byteString.length; i++) {
    ia[i] = byteString.charCodeAt(i);
  }

  return new Blob([ia], {
    type: mimeString
  });
}
1374926
function dataURLtoBlob(dataUrl) {
    let pos = dataUrl.indexOf(',', 0)
    let arr = [ dataUrl.slice(0, pos), dataUrl.slice(pos+1) ]
    let mime = arr[0].match(/:(.*?);/)[1],
        bstr = atob(arr[1]),
        n = bstr.length,
        u8arr = new Uint8Array(n)
    while(n--) {
        u8arr[n] = bstr.charCodeAt(n)
    }
    return new Blob([ u8arr ], { type:mime })
}
1339555
function getLinkedData(dataType) {
    var mainData = this[MAIN_DATA];
    return (dataType == null || mainData == null)
        ? mainData
        : mainData[DATAS][dataType];
}
597661
function getObjectByKey(data, prop) {
    if (!prop || !~prop.indexOf('.')) return data[prop];

    var result = prop
      , structure = data;

    for (var paths = prop.split('.'), i = 0, length = paths.length; i < length; i++) {
      result = structure[+paths[i] || paths[i]];
      structure = result;
    }

    return result || data[prop];
  }
1321325
function getProcessedUrl(data, resourceName) {
                        // get the raw URL out of the resource name and check if it is valid
                        var url = data[config.linksKey][resourceName][config.linksHrefKey];

                        if (url === undefined || !url) {
                            throw new Error('The provided resource name "' + resourceName + '" has no valid URL in the "' +
                                config.linksHrefKey + '" property.');
                        }

                        // extract the template parameters of the raw URL
                        return extractUrl(url, data[config.linksKey][resourceName].templated);
                    }
816024
function getImageData(img) {
  let data = null;
  return new Promise((reslove, reject) => {
    if (img.src) {
      if (/^data\:/i.test(img.src)) { // Data URI
        data = base64ToArrayBuffer(img.src);
        reslove(data)
      } else if (/^blob\:/i.test(img.src)) { // Object URL
        var fileReader = new FileReader();
        fileReader.onload = function (e) {
          data = e.target.result;
          reslove(data)
        };
        objectURLToBlob(img.src, function (blob) {
          fileReader.readAsArrayBuffer(blob);
        });
      } else {
        var http = new XMLHttpRequest();
        http.onload = function () {
          if (this.status == 200 || this.status === 0) {
            data = http.response
            reslove(data)
          } else {
            throw "Could not load image";
          }
          http = null;
        };
        http.open("GET", img.src, true);
        http.responseType = "arraybuffer";
        http.send(null);
      }
    } else {
      reject('img error')
    }
  })
}
36836
function get(data) {
    if ('string' === typeof data) return { content: data };
    if (data.readme) return { content: data.readme, file: 'readme' };
    if (data.content) return data;
  }
950214
function(data){
		return typeof data === 'object' 
			? JSON.stringify(data) 
			: (typeof data === 'string' || typeof data === 'number' ? String(data) : null);
	}
105312
function getProcessedUrl(data, resourceName) {
                    // get the raw URL out of the resource name and check if it is valid
                    var rawUrl = checkUrl(data[config.linksKey][resourceName][config.linksHrefKey], resourceName,
                        config.linksHrefKey);

                    // extract the template parameters of the raw URL
                    return extractUrl(rawUrl, data[config.linksKey][resourceName].templated);
                }
469372
function(data) {
				if (this.ruid) {
					this.getRuntime().exec.call(this, 'Blob', 'destroy');
					this.disconnectRuntime();
					this.ruid = null;
				}

				data = data || '';

				// if dataUrl, convert to binary string
				var matches = data.match(/^data:([^;]*);base64,/);
				if (matches) {
					this.type = matches[1];
					data = Encode.atob(data.substring(data.indexOf('base64,') + 7));
				}

				this.size = data.length;

				blobpool[this.uid] = data;
			}
336254
function parse(data) {
  try {
    return JSON.parse(data);
  } catch (e) {
    log('Oops! Some problems parsing this ' + (typeof data === 'undefined' ? 'undefined' : _typeof(data)) + '.', 'error', debug);
  }

  return null;
}
323789
function(data, callback) {
    var json
    try {
        json = JSON.parse(data)
    } catch (exc) {
        return callback(exc)
    }
    callback(null, json)
}