bytebuffer
Advanced tools
Comparing version 3.4.0 to 3.5.0
{ | ||
"name": "bytebuffer", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"author": "Daniel Wirtz <dcode@dcode.io>", | ||
@@ -5,0 +5,0 @@ "description": "A full-featured ByteBuffer implementation using typed arrays.", |
@@ -8,3 +8,3 @@ /* | ||
(function(s){function u(k){function g(a,b,c){"undefined"===typeof a&&(a=g.DEFAULT_CAPACITY);"undefined"===typeof b&&(b=g.DEFAULT_ENDIAN);"undefined"===typeof c&&(c=g.DEFAULT_NOASSERT);if(!c){a|=0;if(0>a)throw RangeError("Illegal capacity");b=!!b;c=!!c}this.buffer=0===a?s:new ArrayBuffer(a);this.view=0===a?null:new DataView(this.buffer);this.offset=0;this.markedOffset=-1;this.limit=a;this.littleEndian="undefined"!==typeof b?!!b:!1;this.noAssert=!!c}function m(a){var b=0;return function(){return b< | ||
a.length?a.charCodeAt(b++):null}}function t(){var a=[],b=[];return function(){if(0===arguments.length)return b.join("")+u.apply(String,a);1024<a.length+arguments.length&&(b.push(u.apply(String,a)),a.length=0);Array.prototype.push.apply(a,arguments)}}g.VERSION="3.4.0";g.LITTLE_ENDIAN=!0;g.BIG_ENDIAN=!1;g.DEFAULT_CAPACITY=16;g.DEFAULT_ENDIAN=g.BIG_ENDIAN;g.DEFAULT_NOASSERT=!1;g.Long=k||null;var e=g.prototype,s=new ArrayBuffer(0),u=String.fromCharCode;g.allocate=function(a,b,c){return new g(a,b,c)}; | ||
a.length?a.charCodeAt(b++):null}}function t(){var a=[],b=[];return function(){if(0===arguments.length)return b.join("")+u.apply(String,a);1024<a.length+arguments.length&&(b.push(u.apply(String,a)),a.length=0);Array.prototype.push.apply(a,arguments)}}g.VERSION="3.5.0";g.LITTLE_ENDIAN=!0;g.BIG_ENDIAN=!1;g.DEFAULT_CAPACITY=16;g.DEFAULT_ENDIAN=g.BIG_ENDIAN;g.DEFAULT_NOASSERT=!1;g.Long=k||null;var e=g.prototype,s=new ArrayBuffer(0),u=String.fromCharCode;g.allocate=function(a,b,c){return new g(a,b,c)}; | ||
g.concat=function(a,b,c,d){if("boolean"===typeof b||"string"!==typeof b)d=c,c=b,b=void 0;for(var f=0,n=0,h=a.length,e;n<h;++n)g.isByteBuffer(a[n])||(a[n]=g.wrap(a[n],b)),e=a[n].limit-a[n].offset,0<e&&(f+=e);if(0===f)return new g(0,c,d);b=new g(f,c,d);d=new Uint8Array(b.buffer);for(n=0;n<h;)c=a[n++],e=c.limit-c.offset,0>=e||(d.set((new Uint8Array(c.buffer)).subarray(c.offset,c.limit),b.offset),b.offset+=e);b.limit=b.offset;b.offset=0;return b};g.isByteBuffer=function(a){return!0===(a&&a instanceof | ||
@@ -86,2 +86,2 @@ g)};g.type=function(){return ArrayBuffer};g.wrap=function(a,b,c,d){"string"!==typeof b&&(d=c,c=b,b=void 0);if("string"===typeof a)switch("undefined"===typeof b&&(b="utf8"),b){case "base64":return g.fromBase64(a,c);case "hex":return g.fromHex(a,c);case "binary":return g.fromBinary(a,c);case "utf8":return g.fromUTF8(a,c);case "debug":return g.fromDebug(a,c);default:throw Error("Unsupported encoding: "+b);}if(null===a||"object"!==typeof a)throw TypeError("Illegal buffer");if(g.isByteBuffer(a))return b= | ||
b>>>=0;if(0>a||a>b||b>this.buffer.byteLength)throw RangeError("Illegal range: 0 <= "+a+" <= "+b+" <= "+this.buffer.byteLength);}var c;try{l.b(function(){return a<b?this.view.getUint8(a++):null}.bind(this),c=t())}catch(d){if(a!==b)throw RangeError("Illegal range: Truncated data, "+a+" != "+b);}return c()};g.fromUTF8=function(a,b,c){if(!c&&"string"!==typeof a)throw TypeError("Illegal str: Not a string");var d=new g(l.a(m(a),!0)[1],b,c),e=0;l.c(m(a),function(a){d.view.setUint8(e++,a)});d.limit=e;return d}; | ||
return g}"undefined"!==typeof module&&module.exports?module.exports=u(require("long")):"function"===typeof define&&define.amd?define("ByteBuffer",["Long"],function(k){return u(k)}):(s.dcodeIO=s.dcodeIO||{}).ByteBuffer=u(s.dcodeIO.Long)})(this); | ||
return g}"function"===typeof require&&"object"===typeof module&&module&&module.id&&"object"===typeof exports&&exports?module.exports=function(){var k;try{k=require("long")}catch(g){}return u(k)}():"function"===typeof define&&define.amd?define("ByteBuffer",["Long"],function(k){return u(k)}):(s.dcodeIO=s.dcodeIO||{}).ByteBuffer=u(s.dcodeIO.Long)})(this); |
{ | ||
"name": "bytebuffer", | ||
"version": "3.4.0", | ||
"version": "3.5.0", | ||
"author": "Daniel Wirtz <dcode@dcode.io>", | ||
@@ -17,3 +17,3 @@ "description": "The swiss army knife for binary data in JavaScript.", | ||
"dependencies": { | ||
"long": "~2", | ||
"long": "~2 >=2.2", | ||
"bufferview": "~1" | ||
@@ -20,0 +20,0 @@ }, |
@@ -39,4 +39,7 @@ /* | ||
/* CommonJS */ if (typeof module !== 'undefined' && module["exports"]) | ||
module["exports"] = loadByteBuffer(require("long")); | ||
/* CommonJS */ if (typeof require === 'function' && typeof module === 'object' && module && module.id && typeof exports === 'object' && exports) | ||
module['exports'] = (function() { | ||
var Long; try { Long = require("long"); } catch (e) {} | ||
return loadByteBuffer(Long); | ||
})(); | ||
/* AMD */ else if (typeof define === 'function' && define["amd"]) | ||
@@ -43,0 +46,0 @@ define("ByteBuffer", ["Long"], function(Long) { return loadByteBuffer(Long); }); |
@@ -944,4 +944,6 @@ /* | ||
module: { | ||
exports: {} | ||
exports: {}, | ||
id: "bytebuffer" | ||
}, | ||
exports: {}, | ||
ArrayBuffer: ArrayBuffer, | ||
@@ -948,0 +950,0 @@ DataView: DataView |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
686125
11742
Updatedlong@~2 >=2.2