Comparing version 0.9.3 to 0.9.4
@@ -71,3 +71,3 @@ let decoder | ||
} | ||
if (this) { | ||
if (this instanceof Decoder) { | ||
currentDecoder = this | ||
@@ -910,4 +910,2 @@ packedValues = this.sharedValues && | ||
} | ||
export const useRecords = false | ||
export const mapsAsObjects = true | ||
let defaultDecoder = new Decoder({ useRecords: false }) | ||
@@ -914,0 +912,0 @@ export const decode = defaultDecoder.decode |
@@ -69,3 +69,3 @@ (function (global, factory) { | ||
} | ||
if (this) { | ||
if (this instanceof Decoder) { | ||
currentDecoder = this; | ||
@@ -72,0 +72,0 @@ packedValues = this.sharedValues && |
@@ -44,3 +44,3 @@ (function(a,b){"object"==typeof exports&&"undefined"!=typeof module?b(exports):"function"==typeof define&&define.amd?define(["exports"],b):(a=a||self,b(a.CBOR={}))})(this,function(a){'use strict';function b(){try{let a=c();if(B==A)// finished reading this source, cleanup references | ||
// new ones | ||
try{I=a.dataView||(a.dataView=new DataView(a.buffer,a.byteOffset,a.byteLength))}catch(b){if(z=null,a instanceof Uint8Array)throw b;throw new Error("Source must be a Uint8Array or Buffer but was a "+(a&&"object"==typeof a?a.constructor.name:typeof a))}if(this){if(K=this,H=this.sharedValues&&(this.pack?Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return E=this.structures,b();(!E||0<E.length)&&(E=[])}else K=P,(!E||0<E.length)&&(E=[]),H=null;return b()}decodeMultiple(a,c){let d,e=0;try{let f=a.length;Q=!0;let g=this?this.decode(a,f):ba.decode(a,f);if(c){if(!1===c(g))return;for(;B<f;)if(e=B,!1===c(b()))return}else{for(d=[g];B<f;)e=B,d.push(b());return d}}catch(a){throw a.lastPosition=e,a.values=d,a}finally{Q=!1,o()}}}const S=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;let T=f,U=String.fromCharCode,V=Array(4096);class W{constructor(a){this.value=a}}let X="object"==typeof window?window:global;N[0]=a=>new Date(a),N[1]=a=>new Date(1e3*a),N[2]=a=>new DataView(a.buffer,a.byteOffset,a.byteLength).getBigUint64(0),N[3]=a=>BigInt(-1)-new DataView(a.buffer,a.byteOffset,a.byteLength).getBigUint64(0);// the registration of the record definition extension (tag 105) | ||
try{I=a.dataView||(a.dataView=new DataView(a.buffer,a.byteOffset,a.byteLength))}catch(b){if(z=null,a instanceof Uint8Array)throw b;throw new Error("Source must be a Uint8Array or Buffer but was a "+(a&&"object"==typeof a?a.constructor.name:typeof a))}if(this instanceof R){if(K=this,H=this.sharedValues&&(this.pack?Array(this.maxPrivatePackedValues||16).concat(this.sharedValues):this.sharedValues),this.structures)return E=this.structures,b();(!E||0<E.length)&&(E=[])}else K=P,(!E||0<E.length)&&(E=[]),H=null;return b()}decodeMultiple(a,c){let d,e=0;try{let f=a.length;Q=!0;let g=this?this.decode(a,f):ba.decode(a,f);if(c){if(!1===c(g))return;for(;B<f;)if(e=B,!1===c(b()))return}else{for(d=[g];B<f;)e=B,d.push(b());return d}}catch(a){throw a.lastPosition=e,a.values=d,a}finally{Q=!1,o()}}}const S=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;let T=f,U=String.fromCharCode,V=Array(4096);class W{constructor(a){this.value=a}}let X="object"==typeof window?window:global;N[0]=a=>new Date(a),N[1]=a=>new Date(1e3*a),N[2]=a=>new DataView(a.buffer,a.byteOffset,a.byteLength).getBigUint64(0),N[3]=a=>BigInt(-1)-new DataView(a.buffer,a.byteOffset,a.byteLength).getBigUint64(0);// the registration of the record definition extension (tag 105) | ||
const Y=()=>{let a=c(),b=a[0],e=a[1];E[255&e]=b,b.read=d(b);let f={};for(let c,d=2,e=a.length;d<e;d++)c=b[d-2],f[c]=a[d];return f};Y.handlesRead=!0,N[105]=Y,N[27]=a=>(X[a[0]]||Error)(a[1],a[2]);const Z=a=>{if(132!=z[B++])throw new Error("Packed values structure must be followed by 4 element array");let b=a();// packed values | ||
@@ -47,0 +47,0 @@ return H=H?b.concat(H.slice(b.length)):b,H.prefixes=a(),H.suffixes=a(),a();// read the rump |
{ | ||
"name": "cbor-x", | ||
"author": "Kris Zyp", | ||
"version": "0.9.3", | ||
"version": "0.9.4", | ||
"description": "Ultra-fast CBOR implementation with tag extensions for records and structured cloning", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
Sorry, the diff of this file is not supported yet
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
432687
8614