Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a-msgpack

Package Overview
Dependencies
Maintainers
1
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-msgpack - npm Package Compare versions

Comparing version 4.5.4 to 4.5.5

8

CHANGELOG.md

@@ -6,2 +6,10 @@ # Change Log

## [4.5.5](https://github.com/aristanetworks/cloudvision/compare/v4.5.4...v4.5.5) (2020-09-16)
**Note:** Version bump only for package a-msgpack
## [4.5.4](https://github.com/aristanetworks/cloudvision/compare/v4.5.3...v4.5.4) (2020-08-10)

@@ -8,0 +16,0 @@

14

dist/MsgPack.js

@@ -7,4 +7,6 @@ (function (global, factory) {

JSBI = JSBI && Object.prototype.hasOwnProperty.call(JSBI, 'default') ? JSBI['default'] : JSBI;
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var JSBI__default = /*#__PURE__*/_interopDefaultLegacy(JSBI);
/**

@@ -115,3 +117,3 @@ * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.

if (typeof BigInt === 'undefined' || forceJSBI) {
BI = JSBI.BigInt;
BI = JSBI__default['default'].BigInt;
}

@@ -409,3 +411,3 @@ else {

const low = view.getUint32(offset + 4);
return JSBI.BigInt(bufferToString(high, low, false));
return JSBI__default['default'].BigInt(bufferToString(high, low, false));
}

@@ -418,3 +420,3 @@ return view.getBigInt64(offset);

const low = view.getUint32(offset + 4);
return JSBI.BigInt(bufferToString(high, low, true));
return JSBI__default['default'].BigInt(bufferToString(high, low, true));
}

@@ -851,4 +853,4 @@ return view.getBigUint64(offset);

if (strValue === '0' ||
(JSBI.LE(value, 0x7fffffff) && JSBI.GE(value, -0xffffffff)) ||
(strValue < '0' && JSBI.GE(value, -0xffffffff))) {
(JSBI__default['default'].LE(value, 0x7fffffff) && JSBI__default['default'].GE(value, -0xffffffff)) ||
(strValue < '0' && JSBI__default['default'].GE(value, -0xffffffff))) {
this.encodeNumber(Number(value));

@@ -855,0 +857,0 @@ }

@@ -1,1 +0,1 @@

!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jsbi"),require("base64-js")):"function"==typeof define&&define.amd?define(["exports","jsbi","base64-js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["a-msgpack"]={},t.jsbi,t.base64Js)}(this,(function(t,e,i){"use strict";e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;class s{constructor(t,e){this.type=t,this.data=e,this.type=t,this.data=e}}class n{constructor(){this.encoders=[],this.decoders=[],this.identifiers=[]}register({type:t,identifier:e,encode:i,decode:s}){this.encoders[t]=i,this.decoders[t]=s,this.identifiers.push(e)}encode(t){let e=null;for(let i=0;i<this.identifiers.length;i++){(0,this.identifiers[i])(t)&&(e=i)}if(null===e)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(t));const i=(0,this.encoders[e])(t);return new s(e,i)}decode(t,e){return(0,this.decoders[e])(t,e)}}function r(t){return Array.isArray(t)&&"__clzmsd"in t}n.defaultCodec=new n;class o{constructor(t){this.type=o.type,this.value=t?parseFloat(String(t)):0}toString(){const t=this.value.toString();return t.includes(".")?t:this.value.toFixed(1)}}o.type="float32";class h{constructor(t){this.type=h.type,this.value=t?parseFloat(String(t)):0}toString(){const t=this.value.toString();return t.includes(".")?t:this.value.toFixed(1)}}h.type="float64";class a{constructor(t,i=!1){if(this.type=a.type,"string"==typeof t){let s;s="undefined"==typeof BigInt||i?e.BigInt:BigInt,this.value=parseInt(t,10)>Number.MAX_SAFE_INTEGER||parseInt(t,10)<-1*Number.MAX_SAFE_INTEGER?s(t):parseInt(t,10)}else"bigint"==typeof t||r(t)?this.value=t:this.value=parseInt(String(t),10)}toString(){return this.value.toString()}}a.type="int";class c{constructor(t){this.type=c.type,this.value=!!t}toString(){return this.value?"true":"false"}}c.type="bool";class f{constructor(){this.type=f.type,this.value=null}toString(){return"null"}}f.type="nil";class u{constructor(t){switch(this.type=u.type,typeof t){case"string":this.value=t;break;case"bigint":this.value=t.toString();break;case"undefined":this.value="";break;default:this.value=JSON.stringify(t)}r(t)&&(this.value=t.toString())}toString(){return this.value}}u.type="str";class l{constructor(t=[]){let e;if(this.delimiter="/",this.type=l.type,Array.isArray(t))this.value=t;else{e="string"!=typeof t?JSON.stringify(t):t;const i=e.split(this.delimiter);for(;""===i[0];)i.shift();this.value=i.map(t=>{try{return JSON.parse(t)}catch(t){}return t})}}toString(){return this.value.map(t=>"string"==typeof t?t:JSON.stringify(t)).join(this.delimiter)}}l.type="ptr";class d{constructor(){this.type=d.type,this.value=null}toString(){return"*"}}function p(t){if("object"==typeof t&&null!==t&&2===Object.keys(t).length&&"type"in t&&"value"in t){const e=t;return[c.type,o.type,h.type,a.type,f.type,u.type].includes(e.type)}return!1}function y(t,e){return function(t,e){const i=Math.min(t.length,e.length);if(t===e)return 0;for(let s=0;s<i;s+=1)if(t[s]!==e[s])return t[s]-e[s];return t.length-e.length}(t[0],e[0])}d.type="*";class g{static serialize(t){return{__neatTypeClass:t.type,value:t.value}}static deserialize(t){return new g.NEAT_TYPE_MAP[t.__neatTypeClass](t.value)}}function w(t,e,i){let s=t,n=e;const r=!i&&2147483648&t;r&&(s=~t,n=4294967296-e);let o="";for(;;){const t=s%10*4294967296+n;if(s=Math.floor(s/10),n=Math.floor(t/10),o=(t%10).toString(10)+o,!s&&!n)break}return r&&(o="-"+o),o}function U(t,e,i){let s=0;const n=i.length;let r=0,o=0;"-"===i[0]&&s++;const h=s;for(;s<n;){const t=parseInt(i[s++],10);if(Number.isNaN(t)||t<0)break;o=10*o+t,r=10*r+Math.floor(o/4294967296),o%=4294967296}h&&(r=~r,o?o=4294967296-o:r++),t.setUint32(e,r),t.setUint32(e+4,o)}function b(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}g.NEAT_TYPE_MAP={float32:o,float64:h,int:a,ptr:l,str:u,nil:f,bool:c};const S="never"!==process.env.TEXT_ENCODING&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function v(t){const e=t.length;let i=0,s=0;for(;s<e;){let n=t.charCodeAt(s++);if(0!=(4294967168&n))if(0==(4294965248&n))i+=2;else{if(n>=55296&&n<=56319&&s<e){const e=t.charCodeAt(s);56320==(64512&e)&&(++s,n=((1023&n)<<10)+(1023&e)+65536)}i+=0==(4294901760&n)?3:4}else i++}return i}const x=S?new TextEncoder:void 0,B="force"!==process.env.TEXT_ENCODING?200:0;const m=(null==x?void 0:x.encodeInto)?function(t,e,i){x.encodeInto(t,e.subarray(i))}:function(t,e,i){e.set(x.encode(t),i)};function I(t,e,i){let s=e;const n=s+i,r=[];let o="";for(;s<n;){const e=t[s++];if(0==(128&e))r.push(e);else if(192==(224&e)){const i=63&t[s++];r.push((31&e)<<6|i)}else if(224==(240&e)){const i=63&t[s++],n=63&t[s++];r.push((31&e)<<12|i<<6|n)}else if(240==(248&e)){let i=(7&e)<<18|(63&t[s++])<<12|(63&t[s++])<<6|63&t[s++];i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i)}else r.push(e);r.length>=4096&&(o+=String.fromCharCode(...r),r.length=0)}return r.length>0&&(o+=String.fromCharCode(...r)),o}const E=S?new TextDecoder:null,A="force"!==process.env.TEXT_DECODER?200:0;class N{constructor(t=n.defaultCodec,e=100,i=2048){this.pos=0,this.extensionCodec=t,this.maxDepth=e,this.initialBufferSize=i,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}keyEncoder(t,e){const i=new N(this.extensionCodec,this.maxDepth,this.initialBufferSize);return i.encode(t,e),i.getUint8Array()}encode(t,e){if(e>this.maxDepth)throw new Error("Too deep objects in depth "+e);null==t?this.encodeNil():"boolean"==typeof t?this.encodeBoolean(t):"number"==typeof t?this.encodeNumber(t):"string"==typeof t?this.encodeString(t):this.encodeObject(t,e)}getUint8Array(){return this.bytes.subarray(0,this.pos)}ensureBufferSizeToWrite(t){const e=this.pos+t;this.view.byteLength<e&&this.resizeBuffer(2*e)}resizeBuffer(t){const e=new ArrayBuffer(t),i=new Uint8Array(e),s=new DataView(e);i.set(this.bytes),this.view=s,this.bytes=i}encodeNil(){this.writeU8(192)}encodeBoolean(t){!1===t?this.writeU8(194):this.writeU8(195)}encodeNumber(t){Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):(this.writeU8(211),this.writeI64(t)):(this.writeU8(203),this.writeF64(t))}writeStringHeader(t){t<256?(this.writeU8(196),this.writeU8(t)):t<65536?(this.writeU8(197),this.writeU16(t)):(this.writeU8(198),this.writeU32(t))}encodeString(t){const e=t.length;if(S&&e>B){const e=v(t);this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),m(t,this.bytes,this.pos),this.pos+=e}else{const e=v(t);this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),function(t,e,i){const s=t.length;let n=i,r=0;for(;r<s;){let i=t.charCodeAt(r++);if(0!=(4294967168&i)){if(0==(4294965248&i))e[n++]=i>>6&31|192;else{if(i>=55296&&i<=56319&&r<s){const e=t.charCodeAt(r);56320==(64512&e)&&(++r,i=((1023&i)<<10)+(1023&e)+65536)}0==(4294901760&i)?(e[n++]=i>>12&15|224,e[n++]=i>>6&63|128):(e[n++]=i>>18&7|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128)}e[n++]=63&i|128}else e[n++]=i}}(t,this.bytes,this.pos),this.pos+=e}}encodeObject(t,e){if(Array.isArray(t))r(t)?this.encodeJSBI(t):this.encodeArray(t,e);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if("bigint"==typeof t)this.encodeBigInt(t);else if(t instanceof Map)this.encodeMap(t,e);else if("object"==typeof t)p(t)?this.encodeNeatClass(t):!function(t){if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)?this.encodeExtension(this.extensionCodec.encode(t)):this.encodePlainObject(t,e);else{if("function"!=typeof t)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(t));this.encodeNil()}}encodeNeatClass(t){t instanceof o?(this.writeU8(202),this.writeF32(t.value)):t instanceof h?(this.writeU8(203),this.writeF64(t.value)):t instanceof a?"bigint"==typeof t.value?this.encodeBigInt(t.value):r(t.value)?this.encodeJSBI(t.value):this.encodeNumber(t.value):t instanceof u?this.encodeString(t.value):t instanceof c?this.encodeBoolean(t.value):this.encodeNil()}encodeBigInt(t){t===BigInt(0)||BigInt.asIntN(32,t)>0||t<0&&BigInt.asUintN(32,t)===t*BigInt(-1)?this.encodeNumber(Number(t)):t<0?(this.writeU8(211),this.writeI64(t)):(this.writeU8(207),this.writeU64(t))}encodeJSBI(t){const i=t.toString();"0"===i||e.LE(t,2147483647)&&e.GE(t,-4294967295)||i<"0"&&e.GE(t,-4294967295)?this.encodeNumber(Number(t)):i<"0"?(this.writeU8(211),this.writeI64(i)):(this.writeU8(207),this.writeU64(i))}encodeBinary(t){const e=t.byteLength;e<256?(this.writeU8(196),this.writeU8(e)):e<65536?(this.writeU8(197),this.writeU16(e)):(this.writeU8(198),this.writeU32(e));const i=b(t);this.writeU8a(i)}encodeArray(t,e){const i=t.length;i<16?this.writeU8(144+i):i<65536?(this.writeU8(220),this.writeU16(i)):(this.writeU8(221),this.writeU32(i));for(const i of t)this.encode(i,e+1)}encodeMap(t,e){const i=t.size,s=[];i<16?this.writeU8(128+i):i<65536?(this.writeU8(222),this.writeU16(i)):(this.writeU8(223),this.writeU32(i)),t.forEach((t,i)=>{const n=this.keyEncoder(i,e+1);s.push([n,t])}),s.sort(y),s.forEach(t=>{this.writeU8a(t[0]),this.encode(t[1],e+1)})}encodePlainObject(t,e){this.encodeMap(new Map(Object.entries(t)),e)}encodeExtension(t){const e=t.data.length;1===e?this.writeU8(212):2===e?this.writeU8(213):4===e?this.writeU8(214):8===e?this.writeU8(215):16===e?this.writeU8(216):e<256?(this.writeU8(199),this.writeU8(e)):e<65536?(this.writeU8(200),this.writeU16(e)):(this.writeU8(201),this.writeU32(e)),this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const e=t.length;this.ensureBufferSizeToWrite(e),this.bytes.set(t,this.pos),this.pos+=e}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),function(t,e,i){if("number"==typeof i){const s=i/4294967296,n=i;t.setUint32(e,s),t.setUint32(e+4,n)}else"bigint"==typeof i?t.setBigUint64(e,i):"string"==typeof i&&U(t,e,i)}(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),function(t,e,i){if("number"==typeof i){const s=Math.floor(i/4294967296),n=i;t.setUint32(e,s),t.setUint32(e+4,n)}else"bigint"==typeof i?t.setBigInt64(e,i):"string"==typeof i&&U(t,e,i)}(this.view,this.pos,t),this.pos+=8}}const T={};function L(t,e=T){const i=new N(e.extensionCodec,e.maxDepth,e.initialBufferSize);return i.encode(t,1),i.getUint8Array()}const k=t=>"string"===typeof t,O=new DataView(new ArrayBuffer(0)),z=new Uint8Array(O.buffer),C=new class{constructor(t=16,e=16){this.maxKeyLength=t,this.maxLengthPerKey=e,this.caches=[];for(let t=0;t<this.maxKeyLength;t++)this.caches.push([])}canBeCached(t){return t>0&&t<=this.maxKeyLength}get(t,e,i){const s=this.caches[i-1],n=s.length;t:for(let r=0;r<n;r++){const n=s[r],o=n.bytes;for(let s=0;s<i;s++)if(o[s]!==t[e+s])continue t;return n.value}return null}store(t,e){const i=this.caches[t.length-1],s={bytes:t,value:e};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=s:i.push(s)}decode(t,e,i){const s=this.get(t,e,i);if(s)return s;const n=I(t,e,i),r=Uint8Array.prototype.slice.call(t,e,e+i);return this.store(r,n),n}};class M{constructor(t=n.defaultCodec,e=!1,i=4294967295,s=4294967295,r=4294967295,o=4294967295,h=4294967295,a=C){this.totalPos=0,this.pos=0,this.view=O,this.bytes=z,this.stack=[],this.extensionCodec=t,this.cachedKeyDecoder=a,this.useJSBI=e,this.maxStrLength=i,this.maxBinLength=s,this.maxArrayLength=r,this.maxMapLength=o,this.maxExtLength=h}setBuffer(t){this.bytes=b(t),this.view=function(t){if(t instanceof ArrayBuffer)return new DataView(t);const e=b(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}(this.bytes),this.pos=0}hasRemaining(t=1){return this.view.byteLength-this.pos>=t}createNoExtraBytesError(t){const{view:e,pos:i}=this;return new RangeError(`Extra ${e.byteLength-i} byte(s) found at buffer[${t}]`)}decodeSingleSync(){const t=this.decodeSync();if(this.hasRemaining())throw this.createNoExtraBytesError(this.pos);return t}decodeSync(){t:for(;;){const e=this.readU8();let s;if(e>=224)s=e-256;else if(e<192)if(e<128)s=e;else if(e<144){const t=e-128;if(0!==t){this.pushMapState(t);continue t}s={}}else{const t=e-144;if(0!==t){this.pushArrayState(t);continue t}s=[]}else if(192===e)s=null;else if(194===e)s=!1;else if(195===e)s=!0;else if(202===e)s=this.readF32();else if(203===e)s=this.readF64();else if(204===e)s=this.readU8();else if(205===e)s=this.readU16();else if(206===e)s=this.readU32();else if(207===e)s=this.readU64();else if(208===e)s=this.readI8();else if(209===e)s=this.readI16();else if(210===e)s=this.readI32();else if(211===e)s=this.readI64();else{if(220===e){const t=this.readU16();this.pushArrayState(t);continue t}if(221===e){const t=this.readU32();this.pushArrayState(t);continue t}if(222===e){const t=this.readU16();this.pushMapState(t);continue t}if(223===e){const t=this.readU32();this.pushMapState(t);continue t}if(196===e){const t=this.lookU8();s=this.decodeUtf8String(t,1)}else if(197===e){const t=this.lookU16();s=this.decodeUtf8String(t,2)}else if(198===e){const t=this.lookU32();s=this.decodeUtf8String(t,4)}else if(212===e)s=this.decodeExtension(1,0);else if(213===e)s=this.decodeExtension(2,0);else if(214===e)s=this.decodeExtension(4,0);else if(215===e)s=this.decodeExtension(8,0);else if(216===e)s=this.decodeExtension(16,0);else if(199===e){const t=this.lookU8();s=this.decodeExtension(t,1)}else if(200===e){const t=this.lookU16();s=this.decodeExtension(t,2)}else{if(201!==e)throw new Error("Unrecognized type byte: "+`${(t=e)<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`);{const t=this.lookU32();s=this.decodeExtension(t,4)}}}const n=this.stack;for(;n.length>0;){const t=n[n.length-1];if(0===t.type){if(t.array[t.position]=s,t.position++,t.position!==t.size)continue t;n.pop(),s=t.array}else{if(1===t.type){k(s)||(t.serializedKey=i.fromByteArray(this.bytes.slice(t.keyStart,this.pos))),t.key=s,t.type=2;continue t}if(k(t.key)?t.map[t.key]=s:t.map[t.serializedKey]={_key:t.key,_value:s},t.readCount++,t.readCount!==t.size){t.key=null,t.type=1,n[n.length-1].keyStart=this.pos;continue t}n.pop(),s=t.map}}return s}var t}pushMapState(t){if(t>this.maxMapLength)throw new Error(`Max length exceeded: map length (${t}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.push({type:1,size:t,keyStart:1,key:null,serializedKey:null,readCount:0,map:{}})}pushArrayState(t){if(t>this.maxArrayLength)throw new Error(`Max length exceeded: array length (${t}) > maxArrayLength (${this.maxArrayLength})`);this.stack.push({type:0,size:t,keyStart:1,array:new Array(t),position:0})}decodeUtf8String(t,e){var i;if(t>this.maxStrLength)throw new Error(`Max length exceeded: UTF-8 byte length (${t}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+e+t)throw new RangeError("Insufficient data");const s=this.pos+e;let n;return n=this.stateIsMapKey()&&(null===(i=this.cachedKeyDecoder)||void 0===i?void 0:i.canBeCached(t))?this.cachedKeyDecoder.decode(this.bytes,s,t):S&&t>A?function(t,e,i){const s=t.subarray(e,e+i);return E.decode(s)}(this.bytes,s,t):I(this.bytes,s,t),this.pos+=e+t,n}stateIsMapKey(){if(this.stack.length>0){return 1===this.stack[this.stack.length-1].type}return!1}decodeBinary(t,e){if(t>this.maxBinLength)throw new Error(`Max length exceeded: bin length (${t}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(t+e))throw new RangeError("Insufficient data");const i=this.pos+e,s=this.bytes.subarray(i,i+t);return this.pos+=e+t,s}decodeExtension(t,e){if(t>this.maxExtLength)throw new Error(`Max length exceeded: ext length (${t}) > maxExtLength (${this.maxExtLength})`);const i=this.view.getInt8(this.pos+e),s=this.decodeBinary(t,e+1);return this.extensionCodec.decode(s,i)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const t=this.view.getUint8(this.pos);return this.pos++,t}readI8(){const t=this.view.getInt8(this.pos);return this.pos++,t}readU16(){const t=this.view.getUint16(this.pos);return this.pos+=2,t}readI16(){const t=this.view.getInt16(this.pos);return this.pos+=2,t}readU32(){const t=this.view.getUint32(this.pos);return this.pos+=4,t}readI32(){const t=this.view.getInt32(this.pos);return this.pos+=4,t}readU64(){const t=function(t,i,s){if(!t.getBigUint64||s){const s=t.getUint32(i),n=t.getUint32(i+4);return e.BigInt(w(s,n,!0))}return t.getBigUint64(i)}(this.view,this.pos,this.useJSBI);return this.pos+=8,t}readI64(){const t=function(t,i,s){if(!t.getBigInt64||s){const s=t.getInt32(i),n=t.getUint32(i+4);return e.BigInt(w(s,n,!1))}return t.getBigInt64(i)}(this.view,this.pos,this.useJSBI);return this.pos+=8,t}readF32(){const t=this.view.getFloat32(this.pos);return this.pos+=4,t}readF64(){const t=this.view.getFloat64(this.pos);return this.pos+=8,t}}const j={};function F(t,e=j){const i=new M(e.extensionCodec,e.useJSBI,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength,e.cachedKeyDecoder);return i.setBuffer(t),i.decodeSingleSync()}function _(t){const e=typeof t;if("number"===e){return String(t).split(".").length>1?new h(t):new a(t)}if("boolean"===e)return new c(t);if("string"===e)return new u(t);if(null!==t&&"object"===e){let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);if(Object.getPrototypeOf(t)===e)return function(t){const e=new Map,i=Object.keys(t);for(let s=0;s<i.length;s+=1){const n=i[s],r=t[n],o=_(n),h=_(r);e.set(o,h)}return e}(t)}return new f}const D={Bool:c,Float32:o,Float64:h,Int:a,Nil:f,Pointer:l,Str:u,Wildcard:d},P=new n;var W;P.register({type:0,identifier:t=>t instanceof l,encode:(W=P,t=>L(t.value,{extensionCodec:W})),decode:function(t){return e=>{const i=F(e,{extensionCodec:t});return Array.isArray(i)?new l(i):new l}}(P)}),P.register({type:1,identifier:t=>t instanceof d,encode:()=>new Uint8Array,decode:()=>new d}),t.Bool=c,t.Codec=P,t.ExtData=s,t.ExtensionCodec=n,t.Float32=o,t.Float64=h,t.Int=a,t.NeatTypeSerializer=g,t.NeatTypes=D,t.Nil=f,t.Pointer=l,t.Str=u,t.createBaseType=_,t.decode=F,t.encode=L,t.isJsbi=r,t.isNeatType=function(t){if("object"==typeof t&&null!==t){if(p(t))return!0;if(3===Object.keys(t).length&&"type"in t&&"value"in t&&"delimiter"in t){return t.type===l.type}}return!1},Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("jsbi"),require("base64-js")):"function"==typeof define&&define.amd?define(["exports","jsbi","base64-js"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self)["a-msgpack"]={},t.jsbi,t.base64Js)}(this,(function(t,e,i){"use strict";function s(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var n=s(e);class r{constructor(t,e){this.type=t,this.data=e,this.type=t,this.data=e}}class o{constructor(){this.encoders=[],this.decoders=[],this.identifiers=[]}register({type:t,identifier:e,encode:i,decode:s}){this.encoders[t]=i,this.decoders[t]=s,this.identifiers.push(e)}encode(t){let e=null;for(let i=0;i<this.identifiers.length;i++){(0,this.identifiers[i])(t)&&(e=i)}if(null===e)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(t));const i=(0,this.encoders[e])(t);return new r(e,i)}decode(t,e){return(0,this.decoders[e])(t,e)}}function h(t){return Array.isArray(t)&&"__clzmsd"in t}o.defaultCodec=new o;class a{constructor(t){this.type=a.type,this.value=t?parseFloat(String(t)):0}toString(){const t=this.value.toString();return t.includes(".")?t:this.value.toFixed(1)}}a.type="float32";class c{constructor(t){this.type=c.type,this.value=t?parseFloat(String(t)):0}toString(){const t=this.value.toString();return t.includes(".")?t:this.value.toFixed(1)}}c.type="float64";class f{constructor(t,e=!1){if(this.type=f.type,"string"==typeof t){let i;i="undefined"==typeof BigInt||e?n.default.BigInt:BigInt,this.value=parseInt(t,10)>Number.MAX_SAFE_INTEGER||parseInt(t,10)<-1*Number.MAX_SAFE_INTEGER?i(t):parseInt(t,10)}else"bigint"==typeof t||h(t)?this.value=t:this.value=parseInt(String(t),10)}toString(){return this.value.toString()}}f.type="int";class u{constructor(t){this.type=u.type,this.value=!!t}toString(){return this.value?"true":"false"}}u.type="bool";class l{constructor(){this.type=l.type,this.value=null}toString(){return"null"}}l.type="nil";class d{constructor(t){switch(this.type=d.type,typeof t){case"string":this.value=t;break;case"bigint":this.value=t.toString();break;case"undefined":this.value="";break;default:this.value=JSON.stringify(t)}h(t)&&(this.value=t.toString())}toString(){return this.value}}d.type="str";class p{constructor(t=[]){let e;if(this.delimiter="/",this.type=p.type,Array.isArray(t))this.value=t;else{e="string"!=typeof t?JSON.stringify(t):t;const i=e.split(this.delimiter);for(;""===i[0];)i.shift();this.value=i.map(t=>{try{return JSON.parse(t)}catch(t){}return t})}}toString(){return this.value.map(t=>"string"==typeof t?t:JSON.stringify(t)).join(this.delimiter)}}p.type="ptr";class y{constructor(){this.type=y.type,this.value=null}toString(){return"*"}}function g(t){if("object"==typeof t&&null!==t&&2===Object.keys(t).length&&"type"in t&&"value"in t){const e=t;return[u.type,a.type,c.type,f.type,l.type,d.type].includes(e.type)}return!1}function w(t,e){return function(t,e){const i=Math.min(t.length,e.length);if(t===e)return 0;for(let s=0;s<i;s+=1)if(t[s]!==e[s])return t[s]-e[s];return t.length-e.length}(t[0],e[0])}y.type="*";class U{static serialize(t){return{__neatTypeClass:t.type,value:t.value}}static deserialize(t){return new U.NEAT_TYPE_MAP[t.__neatTypeClass](t.value)}}function b(t,e,i){let s=t,n=e;const r=!i&&2147483648&t;r&&(s=~t,n=4294967296-e);let o="";for(;;){const t=s%10*4294967296+n;if(s=Math.floor(s/10),n=Math.floor(t/10),o=(t%10).toString(10)+o,!s&&!n)break}return r&&(o="-"+o),o}function S(t,e,i){let s=0;const n=i.length;let r=0,o=0;"-"===i[0]&&s++;const h=s;for(;s<n;){const t=parseInt(i[s++],10);if(Number.isNaN(t)||t<0)break;o=10*o+t,r=10*r+Math.floor(o/4294967296),o%=4294967296}h&&(r=~r,o?o=4294967296-o:r++),t.setUint32(e,r),t.setUint32(e+4,o)}function v(t){return t instanceof Uint8Array?t:ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength):t instanceof ArrayBuffer?new Uint8Array(t):Uint8Array.from(t)}U.NEAT_TYPE_MAP={float32:a,float64:c,int:f,ptr:p,str:d,nil:l,bool:u};const x="never"!==process.env.TEXT_ENCODING&&"undefined"!=typeof TextEncoder&&"undefined"!=typeof TextDecoder;function B(t){const e=t.length;let i=0,s=0;for(;s<e;){let n=t.charCodeAt(s++);if(0!=(4294967168&n))if(0==(4294965248&n))i+=2;else{if(n>=55296&&n<=56319&&s<e){const e=t.charCodeAt(s);56320==(64512&e)&&(++s,n=((1023&n)<<10)+(1023&e)+65536)}i+=0==(4294901760&n)?3:4}else i++}return i}const m=x?new TextEncoder:void 0,I="force"!==process.env.TEXT_ENCODING?200:0;const E=(null==m?void 0:m.encodeInto)?function(t,e,i){m.encodeInto(t,e.subarray(i))}:function(t,e,i){e.set(m.encode(t),i)};function A(t,e,i){let s=e;const n=s+i,r=[];let o="";for(;s<n;){const e=t[s++];if(0==(128&e))r.push(e);else if(192==(224&e)){const i=63&t[s++];r.push((31&e)<<6|i)}else if(224==(240&e)){const i=63&t[s++],n=63&t[s++];r.push((31&e)<<12|i<<6|n)}else if(240==(248&e)){let i=(7&e)<<18|(63&t[s++])<<12|(63&t[s++])<<6|63&t[s++];i>65535&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i)}else r.push(e);r.length>=4096&&(o+=String.fromCharCode(...r),r.length=0)}return r.length>0&&(o+=String.fromCharCode(...r)),o}const N=x?new TextDecoder:null,T="force"!==process.env.TEXT_DECODER?200:0;class L{constructor(t=o.defaultCodec,e=100,i=2048){this.pos=0,this.extensionCodec=t,this.maxDepth=e,this.initialBufferSize=i,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}keyEncoder(t,e){const i=new L(this.extensionCodec,this.maxDepth,this.initialBufferSize);return i.encode(t,e),i.getUint8Array()}encode(t,e){if(e>this.maxDepth)throw new Error("Too deep objects in depth "+e);null==t?this.encodeNil():"boolean"==typeof t?this.encodeBoolean(t):"number"==typeof t?this.encodeNumber(t):"string"==typeof t?this.encodeString(t):this.encodeObject(t,e)}getUint8Array(){return this.bytes.subarray(0,this.pos)}ensureBufferSizeToWrite(t){const e=this.pos+t;this.view.byteLength<e&&this.resizeBuffer(2*e)}resizeBuffer(t){const e=new ArrayBuffer(t),i=new Uint8Array(e),s=new DataView(e);i.set(this.bytes),this.view=s,this.bytes=i}encodeNil(){this.writeU8(192)}encodeBoolean(t){!1===t?this.writeU8(194):this.writeU8(195)}encodeNumber(t){Number.isSafeInteger(t)?t>=0?t<128?this.writeU8(t):t<256?(this.writeU8(204),this.writeU8(t)):t<65536?(this.writeU8(205),this.writeU16(t)):t<4294967296?(this.writeU8(206),this.writeU32(t)):(this.writeU8(207),this.writeU64(t)):t>=-32?this.writeU8(224|t+32):t>=-128?(this.writeU8(208),this.writeI8(t)):t>=-32768?(this.writeU8(209),this.writeI16(t)):t>=-2147483648?(this.writeU8(210),this.writeI32(t)):(this.writeU8(211),this.writeI64(t)):(this.writeU8(203),this.writeF64(t))}writeStringHeader(t){t<256?(this.writeU8(196),this.writeU8(t)):t<65536?(this.writeU8(197),this.writeU16(t)):(this.writeU8(198),this.writeU32(t))}encodeString(t){const e=t.length;if(x&&e>I){const e=B(t);this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),E(t,this.bytes,this.pos),this.pos+=e}else{const e=B(t);this.ensureBufferSizeToWrite(5+e),this.writeStringHeader(e),function(t,e,i){const s=t.length;let n=i,r=0;for(;r<s;){let i=t.charCodeAt(r++);if(0!=(4294967168&i)){if(0==(4294965248&i))e[n++]=i>>6&31|192;else{if(i>=55296&&i<=56319&&r<s){const e=t.charCodeAt(r);56320==(64512&e)&&(++r,i=((1023&i)<<10)+(1023&e)+65536)}0==(4294901760&i)?(e[n++]=i>>12&15|224,e[n++]=i>>6&63|128):(e[n++]=i>>18&7|240,e[n++]=i>>12&63|128,e[n++]=i>>6&63|128)}e[n++]=63&i|128}else e[n++]=i}}(t,this.bytes,this.pos),this.pos+=e}}encodeObject(t,e){if(Array.isArray(t))h(t)?this.encodeJSBI(t):this.encodeArray(t,e);else if(ArrayBuffer.isView(t))this.encodeBinary(t);else if("bigint"==typeof t)this.encodeBigInt(t);else if(t instanceof Map)this.encodeMap(t,e);else if("object"==typeof t)g(t)?this.encodeNeatClass(t):!function(t){if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}(t)?this.encodeExtension(this.extensionCodec.encode(t)):this.encodePlainObject(t,e);else{if("function"!=typeof t)throw new Error("Unrecognized object: "+Object.prototype.toString.apply(t));this.encodeNil()}}encodeNeatClass(t){t instanceof a?(this.writeU8(202),this.writeF32(t.value)):t instanceof c?(this.writeU8(203),this.writeF64(t.value)):t instanceof f?"bigint"==typeof t.value?this.encodeBigInt(t.value):h(t.value)?this.encodeJSBI(t.value):this.encodeNumber(t.value):t instanceof d?this.encodeString(t.value):t instanceof u?this.encodeBoolean(t.value):this.encodeNil()}encodeBigInt(t){t===BigInt(0)||BigInt.asIntN(32,t)>0||t<0&&BigInt.asUintN(32,t)===t*BigInt(-1)?this.encodeNumber(Number(t)):t<0?(this.writeU8(211),this.writeI64(t)):(this.writeU8(207),this.writeU64(t))}encodeJSBI(t){const e=t.toString();"0"===e||n.default.LE(t,2147483647)&&n.default.GE(t,-4294967295)||e<"0"&&n.default.GE(t,-4294967295)?this.encodeNumber(Number(t)):e<"0"?(this.writeU8(211),this.writeI64(e)):(this.writeU8(207),this.writeU64(e))}encodeBinary(t){const e=t.byteLength;e<256?(this.writeU8(196),this.writeU8(e)):e<65536?(this.writeU8(197),this.writeU16(e)):(this.writeU8(198),this.writeU32(e));const i=v(t);this.writeU8a(i)}encodeArray(t,e){const i=t.length;i<16?this.writeU8(144+i):i<65536?(this.writeU8(220),this.writeU16(i)):(this.writeU8(221),this.writeU32(i));for(const i of t)this.encode(i,e+1)}encodeMap(t,e){const i=t.size,s=[];i<16?this.writeU8(128+i):i<65536?(this.writeU8(222),this.writeU16(i)):(this.writeU8(223),this.writeU32(i)),t.forEach((t,i)=>{const n=this.keyEncoder(i,e+1);s.push([n,t])}),s.sort(w),s.forEach(t=>{this.writeU8a(t[0]),this.encode(t[1],e+1)})}encodePlainObject(t,e){this.encodeMap(new Map(Object.entries(t)),e)}encodeExtension(t){const e=t.data.length;1===e?this.writeU8(212):2===e?this.writeU8(213):4===e?this.writeU8(214):8===e?this.writeU8(215):16===e?this.writeU8(216):e<256?(this.writeU8(199),this.writeU8(e)):e<65536?(this.writeU8(200),this.writeU16(e)):(this.writeU8(201),this.writeU32(e)),this.writeI8(t.type),this.writeU8a(t.data)}writeU8(t){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,t),this.pos++}writeU8a(t){const e=t.length;this.ensureBufferSizeToWrite(e),this.bytes.set(t,this.pos),this.pos+=e}writeI8(t){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,t),this.pos++}writeU16(t){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,t),this.pos+=2}writeI16(t){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,t),this.pos+=2}writeU32(t){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,t),this.pos+=4}writeI32(t){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,t),this.pos+=4}writeF32(t){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,t),this.pos+=4}writeF64(t){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,t),this.pos+=8}writeU64(t){this.ensureBufferSizeToWrite(8),function(t,e,i){if("number"==typeof i){const s=i/4294967296,n=i;t.setUint32(e,s),t.setUint32(e+4,n)}else"bigint"==typeof i?t.setBigUint64(e,i):"string"==typeof i&&S(t,e,i)}(this.view,this.pos,t),this.pos+=8}writeI64(t){this.ensureBufferSizeToWrite(8),function(t,e,i){if("number"==typeof i){const s=Math.floor(i/4294967296),n=i;t.setUint32(e,s),t.setUint32(e+4,n)}else"bigint"==typeof i?t.setBigInt64(e,i):"string"==typeof i&&S(t,e,i)}(this.view,this.pos,t),this.pos+=8}}const k={};function z(t,e=k){const i=new L(e.extensionCodec,e.maxDepth,e.initialBufferSize);return i.encode(t,1),i.getUint8Array()}const C=t=>"string"===typeof t,M=new DataView(new ArrayBuffer(0)),O=new Uint8Array(M.buffer),j=new class{constructor(t=16,e=16){this.maxKeyLength=t,this.maxLengthPerKey=e,this.caches=[];for(let t=0;t<this.maxKeyLength;t++)this.caches.push([])}canBeCached(t){return t>0&&t<=this.maxKeyLength}get(t,e,i){const s=this.caches[i-1],n=s.length;t:for(let r=0;r<n;r++){const n=s[r],o=n.bytes;for(let s=0;s<i;s++)if(o[s]!==t[e+s])continue t;return n.value}return null}store(t,e){const i=this.caches[t.length-1],s={bytes:t,value:e};i.length>=this.maxLengthPerKey?i[Math.random()*i.length|0]=s:i.push(s)}decode(t,e,i){const s=this.get(t,e,i);if(s)return s;const n=A(t,e,i),r=Uint8Array.prototype.slice.call(t,e,e+i);return this.store(r,n),n}};class F{constructor(t=o.defaultCodec,e=!1,i=4294967295,s=4294967295,n=4294967295,r=4294967295,h=4294967295,a=j){this.totalPos=0,this.pos=0,this.view=M,this.bytes=O,this.stack=[],this.extensionCodec=t,this.cachedKeyDecoder=a,this.useJSBI=e,this.maxStrLength=i,this.maxBinLength=s,this.maxArrayLength=n,this.maxMapLength=r,this.maxExtLength=h}setBuffer(t){this.bytes=v(t),this.view=function(t){if(t instanceof ArrayBuffer)return new DataView(t);const e=v(t);return new DataView(e.buffer,e.byteOffset,e.byteLength)}(this.bytes),this.pos=0}hasRemaining(t=1){return this.view.byteLength-this.pos>=t}createNoExtraBytesError(t){const{view:e,pos:i}=this;return new RangeError(`Extra ${e.byteLength-i} byte(s) found at buffer[${t}]`)}decodeSingleSync(){const t=this.decodeSync();if(this.hasRemaining())throw this.createNoExtraBytesError(this.pos);return t}decodeSync(){t:for(;;){const e=this.readU8();let s;if(e>=224)s=e-256;else if(e<192)if(e<128)s=e;else if(e<144){const t=e-128;if(0!==t){this.pushMapState(t);continue t}s={}}else{const t=e-144;if(0!==t){this.pushArrayState(t);continue t}s=[]}else if(192===e)s=null;else if(194===e)s=!1;else if(195===e)s=!0;else if(202===e)s=this.readF32();else if(203===e)s=this.readF64();else if(204===e)s=this.readU8();else if(205===e)s=this.readU16();else if(206===e)s=this.readU32();else if(207===e)s=this.readU64();else if(208===e)s=this.readI8();else if(209===e)s=this.readI16();else if(210===e)s=this.readI32();else if(211===e)s=this.readI64();else{if(220===e){const t=this.readU16();this.pushArrayState(t);continue t}if(221===e){const t=this.readU32();this.pushArrayState(t);continue t}if(222===e){const t=this.readU16();this.pushMapState(t);continue t}if(223===e){const t=this.readU32();this.pushMapState(t);continue t}if(196===e){const t=this.lookU8();s=this.decodeUtf8String(t,1)}else if(197===e){const t=this.lookU16();s=this.decodeUtf8String(t,2)}else if(198===e){const t=this.lookU32();s=this.decodeUtf8String(t,4)}else if(212===e)s=this.decodeExtension(1,0);else if(213===e)s=this.decodeExtension(2,0);else if(214===e)s=this.decodeExtension(4,0);else if(215===e)s=this.decodeExtension(8,0);else if(216===e)s=this.decodeExtension(16,0);else if(199===e){const t=this.lookU8();s=this.decodeExtension(t,1)}else if(200===e){const t=this.lookU16();s=this.decodeExtension(t,2)}else{if(201!==e)throw new Error("Unrecognized type byte: "+`${(t=e)<0?"-":""}0x${Math.abs(t).toString(16).padStart(2,"0")}`);{const t=this.lookU32();s=this.decodeExtension(t,4)}}}const n=this.stack;for(;n.length>0;){const t=n[n.length-1];if(0===t.type){if(t.array[t.position]=s,t.position++,t.position!==t.size)continue t;n.pop(),s=t.array}else{if(1===t.type){C(s)||(t.serializedKey=i.fromByteArray(this.bytes.slice(t.keyStart,this.pos))),t.key=s,t.type=2;continue t}if(C(t.key)?t.map[t.key]=s:t.map[t.serializedKey]={_key:t.key,_value:s},t.readCount++,t.readCount!==t.size){t.key=null,t.type=1,n[n.length-1].keyStart=this.pos;continue t}n.pop(),s=t.map}}return s}var t}pushMapState(t){if(t>this.maxMapLength)throw new Error(`Max length exceeded: map length (${t}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.push({type:1,size:t,keyStart:1,key:null,serializedKey:null,readCount:0,map:{}})}pushArrayState(t){if(t>this.maxArrayLength)throw new Error(`Max length exceeded: array length (${t}) > maxArrayLength (${this.maxArrayLength})`);this.stack.push({type:0,size:t,keyStart:1,array:new Array(t),position:0})}decodeUtf8String(t,e){var i;if(t>this.maxStrLength)throw new Error(`Max length exceeded: UTF-8 byte length (${t}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+e+t)throw new RangeError("Insufficient data");const s=this.pos+e;let n;return n=this.stateIsMapKey()&&(null===(i=this.cachedKeyDecoder)||void 0===i?void 0:i.canBeCached(t))?this.cachedKeyDecoder.decode(this.bytes,s,t):x&&t>T?function(t,e,i){const s=t.subarray(e,e+i);return N.decode(s)}(this.bytes,s,t):A(this.bytes,s,t),this.pos+=e+t,n}stateIsMapKey(){if(this.stack.length>0){return 1===this.stack[this.stack.length-1].type}return!1}decodeBinary(t,e){if(t>this.maxBinLength)throw new Error(`Max length exceeded: bin length (${t}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(t+e))throw new RangeError("Insufficient data");const i=this.pos+e,s=this.bytes.subarray(i,i+t);return this.pos+=e+t,s}decodeExtension(t,e){if(t>this.maxExtLength)throw new Error(`Max length exceeded: ext length (${t}) > maxExtLength (${this.maxExtLength})`);const i=this.view.getInt8(this.pos+e),s=this.decodeBinary(t,e+1);return this.extensionCodec.decode(s,i)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){const t=this.view.getUint8(this.pos);return this.pos++,t}readI8(){const t=this.view.getInt8(this.pos);return this.pos++,t}readU16(){const t=this.view.getUint16(this.pos);return this.pos+=2,t}readI16(){const t=this.view.getInt16(this.pos);return this.pos+=2,t}readU32(){const t=this.view.getUint32(this.pos);return this.pos+=4,t}readI32(){const t=this.view.getInt32(this.pos);return this.pos+=4,t}readU64(){const t=function(t,e,i){if(!t.getBigUint64||i){const i=t.getUint32(e),s=t.getUint32(e+4);return n.default.BigInt(b(i,s,!0))}return t.getBigUint64(e)}(this.view,this.pos,this.useJSBI);return this.pos+=8,t}readI64(){const t=function(t,e,i){if(!t.getBigInt64||i){const i=t.getInt32(e),s=t.getUint32(e+4);return n.default.BigInt(b(i,s,!1))}return t.getBigInt64(e)}(this.view,this.pos,this.useJSBI);return this.pos+=8,t}readF32(){const t=this.view.getFloat32(this.pos);return this.pos+=4,t}readF64(){const t=this.view.getFloat64(this.pos);return this.pos+=8,t}}const _={};function D(t,e=_){const i=new F(e.extensionCodec,e.useJSBI,e.maxStrLength,e.maxBinLength,e.maxArrayLength,e.maxMapLength,e.maxExtLength,e.cachedKeyDecoder);return i.setBuffer(t),i.decodeSingleSync()}function P(t){const e=typeof t;if("number"===e){return String(t).split(".").length>1?new c(t):new f(t)}if("boolean"===e)return new u(t);if("string"===e)return new d(t);if(null!==t&&"object"===e){let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);if(Object.getPrototypeOf(t)===e)return function(t){const e=new Map,i=Object.keys(t);for(let s=0;s<i.length;s+=1){const n=i[s],r=t[n],o=P(n),h=P(r);e.set(o,h)}return e}(t)}return new l}const W={Bool:u,Float32:a,Float64:c,Int:f,Nil:l,Pointer:p,Str:d,Wildcard:y},K=new o;var $;K.register({type:0,identifier:t=>t instanceof p,encode:($=K,t=>z(t.value,{extensionCodec:$})),decode:function(t){return e=>{const i=D(e,{extensionCodec:t});return Array.isArray(i)?new p(i):new p}}(K)}),K.register({type:1,identifier:t=>t instanceof y,encode:()=>new Uint8Array,decode:()=>new y}),t.Bool=u,t.Codec=K,t.ExtData=r,t.ExtensionCodec=o,t.Float32=a,t.Float64=c,t.Int=f,t.NeatTypeSerializer=U,t.NeatTypes=W,t.Nil=l,t.Pointer=p,t.Str=d,t.createBaseType=P,t.decode=D,t.encode=z,t.isJsbi=h,t.isNeatType=function(t){if("object"==typeof t&&null!==t){if(g(t))return!0;if(3===Object.keys(t).length&&"type"in t&&"value"in t&&"delimiter"in t){return t.type===p.type}}return!1},Object.defineProperty(t,"__esModule",{value:!0})}));

@@ -5,7 +5,9 @@ 'use strict';

function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
var JSBI = _interopDefault(require('jsbi'));
var JSBI = require('jsbi');
var base64Js = require('base64-js');
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
var JSBI__default = /*#__PURE__*/_interopDefaultLegacy(JSBI);
/**

@@ -116,3 +118,3 @@ * ExtData is used to handle Extension Types that are not registered to ExtensionCodec.

if (typeof BigInt === 'undefined' || forceJSBI) {
BI = JSBI.BigInt;
BI = JSBI__default['default'].BigInt;
}

@@ -410,3 +412,3 @@ else {

const low = view.getUint32(offset + 4);
return JSBI.BigInt(bufferToString(high, low, false));
return JSBI__default['default'].BigInt(bufferToString(high, low, false));
}

@@ -419,3 +421,3 @@ return view.getBigInt64(offset);

const low = view.getUint32(offset + 4);
return JSBI.BigInt(bufferToString(high, low, true));
return JSBI__default['default'].BigInt(bufferToString(high, low, true));
}

@@ -852,4 +854,4 @@ return view.getBigUint64(offset);

if (strValue === '0' ||
(JSBI.LE(value, 0x7fffffff) && JSBI.GE(value, -0xffffffff)) ||
(strValue < '0' && JSBI.GE(value, -0xffffffff))) {
(JSBI__default['default'].LE(value, 0x7fffffff) && JSBI__default['default'].GE(value, -0xffffffff)) ||
(strValue < '0' && JSBI__default['default'].GE(value, -0xffffffff))) {
this.encodeNumber(Number(value));

@@ -856,0 +858,0 @@ }

{
"name": "a-msgpack",
"version": "4.5.4",
"version": "4.5.5",
"description": "A minimalistic NEAT (MessagePack based) encoder and decoder for JavaScript.",

@@ -55,9 +55,9 @@ "author": "Stephane Rufer <stephane@arista.com>",

"base64-js": "1.3.1",
"jsbi": "3.1.2"
"jsbi": "3.1.4"
},
"devDependencies": {
"@arista/prettier-config": "1.1.3",
"@rollup/plugin-commonjs": "14.0.0",
"@rollup/plugin-node-resolve": "8.4.0",
"@rollup/plugin-typescript": "4.1.2",
"@rollup/plugin-commonjs": "15.0.0",
"@rollup/plugin-node-resolve": "9.0.0",
"@rollup/plugin-typescript": "6.0.0",
"@types/base64-js": "1.2.5",

@@ -69,20 +69,20 @@ "@types/jest": "25.2.3",

"eslint-config-airbnb-base": "14.1.0",
"eslint-config-arista-js": "1.1.27",
"eslint-config-arista-ts": "1.1.22",
"eslint-plugin-arista": "0.1.36",
"eslint-config-arista-js": "1.1.28",
"eslint-config-arista-ts": "1.1.23",
"eslint-plugin-arista": "0.1.37",
"eslint-plugin-import": "2.22.0",
"jest": "26.2.2",
"jest": "26.4.2",
"js-yaml": "3.14.0",
"prettier": "2.0.5",
"prettier": "2.1.2",
"rimraf": "3.0.2",
"rollup": "2.23.1",
"rollup-plugin-terser": "5.3.0",
"ts-jest": "26.1.4",
"rollup": "2.26.11",
"rollup-plugin-terser": "7.0.2",
"ts-jest": "26.3.0",
"tslib": "2.0.1",
"typedoc": "0.18.0",
"typedoc-neo-theme": "1.0.9",
"typedoc-plugin-markdown": "2.2.17",
"typescript": "3.9.7"
"typedoc": "0.19.1",
"typedoc-neo-theme": "1.0.10",
"typedoc-plugin-markdown": "2.4.2",
"typescript": "4.0.2"
},
"gitHead": "b83bd7e4e375363ba8e3cff8f5255b08139f79aa"
"gitHead": "6fe11c395fa562d8e1a2e2aaccbde7162114aba8"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc