MCPcopy
hub / github.com/alias-rahil/handwritten.js / f

Function f

docs/blobstream.js:1–1  ·  view source on GitHub ↗
(d,a,b)

Source from the content-addressed store, hash-verified

1!function(c){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=c();else if("function"==typeof define&&define.amd)define([],c);else{var a;"undefined"==typeof window?"undefined"==typeof global?"undefined"!=typeof self&&(a=self):a=global:a=window,a.blobStream=c()}}(function(){var j=Math.min,m=Math.floor;return function l(m,b,c){function e(f,d){if(!b[f]){if(!m[f]){var g="function"==typeof require&&require;if(!d&&g)return g(f,!0);if(a)return a(f,!0);var h=new Error("Cannot find module '"+f+"'");throw h.code="MODULE_NOT_FOUND",h}var i=b[f]={exports:{}};m[f][0].call(i.exports,function(a){var b=m[f][1][a];return e(b?b:a)},i,i.exports,l,m,b,c)}return b[f].exports}for(var a="function"==typeof require&&require,d=0;d<c.length;d++)e(c[d]);return e}({1:[function(c,d){(function(b){function k(f){for(var a,g=0;g<f.length;g++)if(a=f[g],a.buffer instanceof ArrayBuffer){var h=a.buffer;if(a.byteLength!==h.byteLength){var i=new Uint8Array(a.byteLength);i.set(new Uint8Array(h,a.byteOffset,a.byteLength)),h=i.buffer}f[g]=h}}function c(a,b){b=b||{};var g=new f;k(a);for(var d=0;d<a.length;d++)g.append(a[d]);return b.type?g.getBlob(b.type):g.getBlob()}function e(c,a){return k(c),new Blob(c,a||{})}var f=b.BlobBuilder||b.WebKitBlobBuilder||b.MSBlobBuilder||b.MozBlobBuilder,g=function(){try{var b=new Blob(["hi"]);return 2===b.size}catch(b){return!1}}(),h=g&&function(){try{var b=new Blob([new Uint8Array([1,2])]);return 2===b.size}catch(b){return!1}}(),a=f&&f.prototype.append&&f.prototype.getBlob;d.exports=function(){return g?h?b.Blob:e:a?c:void 0}()}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{}],2:[function(i,b){(function(c){function d(){return this instanceof d?void(e.call(this),this._chunks=[],this._blob=null,this.length=0):new d}var e=i("stream").Writable,f=i("util"),g=i("blob"),h=c.URL||c.webkitURL||c.mozURL;f.inherits(d,e),d.prototype._write=function(d,e,b){d instanceof Uint8Array||(d=new Uint8Array(d)),this.length+=d.length,this._chunks.push(d),b()},d.prototype.toBlob=function(b){return b=b||"application/octet-stream",this._blob||(this._blob=new g(this._chunks,{type:b}),this._chunks=[]),this._blob.type!==b&&(this._blob=new g([this._blob],{type:b})),this._blob},d.prototype.toBlobURL=function(a){return h.createObjectURL(this.toBlob(a))},b.exports=d}).call(this,"undefined"==typeof global?"undefined"==typeof self?"undefined"==typeof window?{}:window:self:global)},{blob:1,stream:22,util:25}],3:[function(b,c,e){function n(a,c,d){if(!(this instanceof n))return new n(a,c,d);var e,f=typeof a;if("number"==f)e=0<a?a>>>0:0;else if("string"===f)"base64"===c&&(a=H(a)),e=n.byteLength(a,c);else if("object"===f&&null!==a)"Buffer"===a.type&&M(a.data)&&(a=a.data),e=0<+a.length?m(+a.length):0;else throw new TypeError("must start with number, buffer, array or string");if(1073741823<this.length)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+1073741823 .toString(16)+" bytes");var g;n.TYPED_ARRAY_SUPPORT?g=n._augment(new Uint8Array(e)):(g=this,g.length=e,g._isBuffer=!0);var i;if(n.TYPED_ARRAY_SUPPORT&&"number"==typeof a.byteLength)g._set(a);else if(r(a)){if(n.isBuffer(a))for(i=0;i<e;i++)g[i]=a.readUInt8(i);else for(i=0;i<e;i++)g[i]=(a[i]%256+256)%256;}else if("string"===f)g.write(a,0,c);else if("number"===f&&!n.TYPED_ARRAY_SUPPORT&&!d)for(i=0;i<e;i++)g[i]=0;return g}function q(d,b,c,j){c=+c||0;var k=d.length-c;j?(j=+j,j>k&&(j=k)):j=k;var g=b.length;if(0!=g%2)throw new Error("Invalid hex string");j>g/2&&(j=g/2);for(var h,l=0;l<j;l++){if(h=parseInt(b.substr(2*l,2),16),isNaN(h))throw new Error("Invalid hex string");d[c+l]=h}return l}function i(f,a,b,c){var d=K(x(a),f,b,c);return d}function z(f,a,b,c){var d=K(A(a),f,b,c);return d}function a(e,a,b,c){return z(e,a,b,c)}function d(f,a,b,c){var d=K(J(a),f,b,c);return d}function l(f,a,b,c){var d=K(I(a),f,b,c);return d}function o(d,a,b){return 0===a&&b===d.length?k.fromByteArray(d):k.fromByteArray(d.slice(a,b))}function p(a,b,c){var d="",i="";c=j(a.length,c);for(var k=b;k<c;k++)127>=a[k]?(d+=L(i)+N(a[k]),i=""):i+="%"+a[k].toString(16);return d+L(i)}function s(a,b,c){var d="";c=j(a.length,c);for(var h=b;h<c;h++)d+=N(a[h]);return d}function f(d,a,b){return s(d,a,b)}function h(a,b,h){var i=a.length;(!b||0>b)&&(b=0),(!h||0>h||h>i)&&(h=i);for(var e="",j=b;j<h;j++)e+=B(a[j]);return e}function g(a,b,c){for(var d=a.slice(b,c),e="",h=0;h<d.length;h+=2)e+=N(d[h]+256*d[h+1]);return e}function u(d,a,b){if(0!=d%1||0>d)throw new RangeError("offset is not uint");if(d+a>b)throw new RangeError("Trying to access beyond buffer length")}function F(a,b,c,d,e,f){if(!n.isBuffer(a))throw new TypeError("buffer must be a Buffer instance");if(b>e||b<f)throw new TypeError("value is out of bounds");if(c+d>a.length)throw new TypeError("index out of range")}function y(a,b,c,e){0>b&&(b=65535+b+1);for(var f=0,i=j(a.length-c,2);f<i;f++)a[c+f]=(b&255<<8*(e?f:1-f))>>>8*(e?f:1-f)}function G(a,b,c,e){0>b&&(b=4294967295+b+1);for(var f=0,i=j(a.length-c,4);f<i;f++)a[c+f]=255&b>>>8*(e?f:3-f)}function w(g,a,b,c,d,e){if(a>d||a<e)throw new TypeError("value is out of bounds");if(b+c>g.length)throw new TypeError("index out of range")}function v(f,a,b,c,d){return d||w(f,a,b,4,34028234663852886e22,-34028234663852886e22),D.write(f,a,b,c,23,4),b+4}function E(f,a,b,c,d){return d||w(f,a,b,8,17976931348623157e292,-17976931348623157e292),D.write(f,a,b,c,52,8),b+8}function H(b){for(b=t(b).replace(C,"");0!=b.length%4;)b+="=";return b}function t(b){return b.trim?b.trim():b.replace(/^\s+|\s+$/g,"")}function r(b){return M(b)||n.isBuffer(b)||b&&"object"==typeof b&&"number"==typeof b.length}function B(b){return 16>b?"0"+b.toString(16):b.toString(16)}function x(h){for(var b,i=[],d=0;d<h.length;d++)if(b=h.charCodeAt(d),127>=b)i.push(b);else{var j=d;55296<=b&&57343>=b&&d++;for(var f=encodeURIComponent(h.slice(j,d+1)).substr(1).split("%"),g=0;g<f.length;g++)i.push(parseInt(f[g],16))}return i}function A(d){for(var a=[],b=0;b<d.length;b++)a.push(255&d.charCodeAt(b));return a}function I(a){for(var b,h,i,j=[],f=0;f<a.length;f++)b=a.charCodeAt(f),h=b>>8,i=b%256,j.push(i),j.push(h);return j}function J(b){return k.toByteArray(b)}function K(f,a,b,c){for(var d=0;d<c&&!(d+b>=a.length||d>=f.length);d++)a[d+b]=f[d];return d}function L(b){try{return decodeURIComponent(b)}catch(b){return N(65533)}}/*!
2 * The buffer module from node.js, for the browser.
3 *
4 * @author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>

Callers 5

blobstream.jsFile · 0.70
hFunction · 0.70
gFunction · 0.70
rFunction · 0.70
aFunction · 0.70

Calls 7

readMethod · 0.80
sFunction · 0.70
aFunction · 0.70
wFunction · 0.70
mFunction · 0.70
gFunction · 0.70
toStringMethod · 0.45

Tested by

no test coverage detected