@pixagram/lacerta-db 0.11.2 → 0.11.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.min.js +2 -2
- package/dist/index.min.js +2 -2
- package/index.js +2 -2
- package/package.json +1 -1
- package/readme.md +2 -2
package/dist/browser.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(e=>{var t={};function i(r){var s;return(t[r]||(s=t[r]={i:r,l:!1,exports:{}},e[r].call(s.exports,s,s.exports,i),s.l=!0,s)).exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(r,s,function(t){return e[t]}.bind(null,s));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=2)})([function(e,t){var i={},r=new Float32Array(4);function s(e,t){if((0|e)!==e)throw new TypeError("Lane index must be an int32");if(e<0||t<=e)throw new RangeError("Lane index must be in bounds")}new Int32Array(r.buffer),new Int16Array(r.buffer),new Int8Array(r.buffer),new Uint32Array(r.buffer),new Uint16Array(r.buffer),new Uint8Array(r.buffer),void 0!==i.Int8x16&&void 0!==i.Int8x16.extractLane||(i.Int8x16=function(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y){if(!(this instanceof i.Int8x16))return new i.Int8x16(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y);this.s_=new Int8Array([e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y])},i.Int8x16.check=function(e){if(e instanceof i.Int8x16)return e;throw new TypeError("Argument is not a Int8x16.")},i.Int8x16.splat=function(e){return new i.Int8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Int8x16.extractLane=function(e,t){return e=i.Int8x16.check(e),s(t,16),e.s_[t]},i.Int8x16.replaceLane=function(e,t,r){return e=i.Int8x16.check(e),s(t,16),(e=Array.from(e.s_))[t]=r,new i.Int8x16(...e)},i.Int8x16.shuffle=function(e,t,r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g){var v=[r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g],b=[];e=i.Int8x16.check(e),t=i.Int8x16.check(t);for(var A=0;A<16;A++){var x=v[A];s(x,32),b[A]=x<16?e.s_[x]:t.s_[x-16]}return new i.Int8x16(...b)}),void 0!==i.Uint8x16&&void 0!==i.Uint8x16.extractLane||(i.Uint8x16=function(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y){if(!(this instanceof i.Uint8x16))return new i.Uint8x16(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y);this.s_=new Uint8Array([e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y])},i.Uint8x16.check=function(e){if(e instanceof i.Uint8x16)return e;throw new TypeError("Argument is not a Uint8x16.")},i.Uint8x16.splat=function(e){return new i.Uint8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Uint8x16.extractLane=function(e,t){return e=i.Uint8x16.check(e),s(t,16),e.s_[t]},i.Uint8x16.load=function(e,t){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return new i.Uint8x16(...e.subarray(t,t+16))},i.Uint8x16.store=function(e,t,i){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return e.set(i.s_,t),i},i.Uint8x16.shuffle=function(e,t,r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g){var v=[r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g],b=[];e=i.Uint8x16.check(e),t=i.Uint8x16.check(t);for(var A=0;A<16;A++){var x=v[A];s(x,32),b[A]=x<16?e.s_[x]:t.s_[x-16]}return new i.Uint8x16(...b)},i.Uint8x16.and=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]&t.s_[s];return new i.Uint8x16(...r)},i.Uint8x16.or=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]|t.s_[s];return new i.Uint8x16(...r)},i.Uint8x16.shiftLeftByScalar=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]<<t;return new i.Uint8x16(...r)},i.Uint8x16.shiftRightByScalar=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]>>>t;return new i.Uint8x16(...r)}),e.exports=class{constructor(){this.ENC_SHUFFLE=i.Int8x16(10,11,9,10,7,8,6,7,4,5,3,4,1,2,0,1),this.ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.ENC_LUT_SIMD=[i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0)];for(let t=0;t<4;t++){var e=this.ENC_LUT.substring(16*t,16*(t+1));this.ENC_LUT_SIMD[t]=i.Uint8x16(...Array.from(e).map(e=>e.charCodeAt(0)))}this.DEC_DELTA_ASSO=i.Uint8x16(1,1,1,1,1,1,1,1,0,0,0,0,0,15,0,15),this.DEC_DELTA_VALUES=i.Int8x16(0,0,0,19,4,191,191,185,185,0,16,195,191,191,185,185),this.DEC_SHUFFLE=i.Int8x16(-1,-1,-1,-1,12,13,14,8,9,10,4,5,6,0,1,2),this.SCALAR_ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.SCALAR_DEC_LUT={};for(let e=0;e<this.SCALAR_ENC_LUT.length;e++)this.SCALAR_DEC_LUT[this.SCALAR_ENC_LUT.charAt(e)]=e;this.SCALAR_DEC_LUT["="]=0}_scalar_encode(e){let t="";for(let a=0;a<e.length;a+=3){var i=e[a],r=a+1<e.length?e[a+1]:0,s=a+2<e.length?e[a+2]:0;t+=this.SCALAR_ENC_LUT[i>>2]+this.SCALAR_ENC_LUT[(3&i)<<4|r>>4],a+1<e.length?t+=this.SCALAR_ENC_LUT[(15&r)<<2|s>>6]:t+="=",a+2<e.length?t+=this.SCALAR_ENC_LUT[63&s]:t+="="}return t}encode(e){var t=e.length,i=4*Math.ceil(t/3),r=new Uint8Array(i);let s=0,a=0;for(;s+12<=t;){var n=e.subarray(s,s+12),o=new Uint8Array(16);o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],o[4]=n[3]>>2,o[5]=(3&n[3])<<4|n[4]>>4,o[6]=(15&n[4])<<2|n[5]>>6,o[7]=63&n[5],o[8]=n[6]>>2,o[9]=(3&n[6])<<4|n[7]>>4,o[10]=(15&n[7])<<2|n[8]>>6,o[11]=63&n[8],o[12]=n[9]>>2,o[13]=(3&n[9])<<4|n[10]>>4,o[14]=(15&n[10])<<2|n[11]>>6,o[15]=63&n[11];for(let e=0;e<16;e++)r[a+e]=this.SCALAR_ENC_LUT.charCodeAt(o[e]);s+=12,a+=16}let h=(new TextDecoder).decode(r.subarray(0,a));return s<t&&(h+=this._scalar_encode(e.subarray(s))),h}_scalar_decode(e){e=e.replace(/=+$/,"");var t=Math.floor(3*e.length/4),i=new Uint8Array(t);let r=0;for(let h=0;h<e.length;h+=4){var s=this.SCALAR_DEC_LUT[e[h]],a=this.SCALAR_DEC_LUT[e[h+1]],n=h+2<e.length?this.SCALAR_DEC_LUT[e[h+2]]:0,o=h+3<e.length?this.SCALAR_DEC_LUT[e[h+3]]:0;i[r++]=s<<2|a>>4,r<t&&(i[r++]=(15&a)<<4|n>>2),r<t&&(i[r++]=(3&n)<<6|o)}return i}decode(e){var t=e.length;if(t%4!=0)throw new Error("Invalid Base64 string length.");var i=(e.match(/=/g)||[]).length,r=new Uint8Array(3*t/4-i);let s=0,a=0;for(var n;s+16<=t-i;){var o=Array.from(e.substring(s,s+16)).map(e=>this.SCALAR_DEC_LUT[e]),h=new Uint8Array(12);h[0]=o[0]<<2|o[1]>>4,h[1]=(15&o[1])<<4|o[2]>>2,h[2]=(3&o[2])<<6|o[3],h[3]=o[4]<<2|o[5]>>4,h[4]=(15&o[5])<<4|o[6]>>2,h[5]=(3&o[6])<<6|o[7],h[6]=o[8]<<2|o[9]>>4,h[7]=(15&o[9])<<4|o[10]>>2,h[8]=(3&o[10])<<6|o[11],h[9]=o[12]<<2|o[13]>>4,h[10]=(15&o[13])<<4|o[14]>>2,h[11]=(3&o[14])<<6|o[15],r.set(h,a),s+=16,a+=12}return s<t&&(n=this._scalar_decode(e.substring(s)),r.set(n,a)),r}}},function(e,t,i){i.r(t);let r=240,s=0,a=16,n=32,o=48,h=64,c=80,l=96,d=112,u=128,_=144,f=160,p=176,y=192,w=224,m=240,g=0,v=1,b=2,A=3,x=16,S=17,k=18,z=19,I=20,E=21,U=22,C=23,D=24,M=25,T=26,B=32,V=33,L=34,P=35,O=48,F=49,K=50,R=51,q=52,$=53,j=54,N=55,H=64,G=65,W=66,Q=67,Y=68,J=69,X=70,Z=71,ee=80,te=81,ie=82,re=83,se=84,ae=85,ne=96,oe=97,he=98,ce=99,le=100,de=101,ue=102,_e=103,fe=104,pe=105,ye=106,we=107,me=112,ge=113,ve=114,be=128,Ae=129,xe=144,Se=145,ke=160,ze=161,Ie=162,Ee=163,Ue=164,Ce=165,De=166,Me=167,Te=168,Be=176,Ve=192,Le=193,Pe=208,Oe=209,Fe=224,Ke=225,Re=226,qe=227,$e=240,je=new Uint8Array(256),Ne=new Uint8Array(256);new Map;let He=new Map,Ge=new Map;var We=[[S,2],[k,4],[z,4],[I,4],[E,8],[B,8],[V,8]];for(let e=0;e<We.length;e++)je[We[e][0]]=We[e][1];var Qe,Ye=[[ne,1],[oe,1],[he,1],[ce,2],[le,2],[de,4],[ue,4],[_e,4],[fe,8],[pe,8],[ye,8],[Q,1],[Y,2],[J,4],[X,4],[Z,8]];for(let e=0;e<Ye.length;e++)Ne[Ye[e][0]]=Ye[e][1];for(Qe of["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"]){var Je=Symbol[Qe];Je&&(He.set(Je,Qe),Ge.set(Qe,Je))}class Xe{constructor(e=65536){this.size=(e+128-1&-128)>>>0,this.buffer=new ArrayBuffer(this.size),this.offset=0,this.u8=new Uint8Array(this.buffer),this.view=new DataView(this.buffer),this.pos=0,this.f32View=null,this.f64View=null,this.i32View=null}ensure(e){var t,i;(e=this.pos+(e|=0)|0)>this.size&&(e=(128+(0|Math.max(this.size<<1,128+e))-1&-128)>>>0,t=new ArrayBuffer(e),(i=new Uint8Array(t)).set(this.u8.subarray(0,this.pos)),this.buffer=t,this.u8=i,this.view=new DataView(t),this.size=e,this.f32View=null,this.f64View=null,this.i32View=null)}alignPos(e){e=e-1|0,this.pos=(this.pos+e&~e)>>>0}writeU8(e){this.ensure(1),this.u8[this.pos++]=255&e}writeU16(e){this.alignPos(2),this.ensure(2),this.view.setUint16(this.pos,65535&e,!0),this.pos=this.pos+2|0}writeI16(e){this.alignPos(2),this.ensure(2),this.view.setInt16(this.pos,e,!0),this.pos=this.pos+2|0}writeU32(e){this.alignPos(4),this.ensure(4),this.view.setUint32(this.pos,e>>>0,!0),this.pos=this.pos+4|0}writeI32(e){this.alignPos(4),this.ensure(4),this.view.setInt32(this.pos,0|e,!0),this.pos=this.pos+4|0}writeF32(e){this.alignPos(4),this.ensure(4),this.view.setFloat32(this.pos,+e,!0),this.pos=this.pos+4|0}writeF64(e){this.alignPos(8),this.ensure(8),this.view.setFloat64(this.pos,+e,!0),this.pos=this.pos+8|0}writeBigInt64(e){this.alignPos(8),this.ensure(8),this.view.setBigInt64(this.pos,BigInt(e),!0),this.pos=this.pos+8|0}writeVarint(e){if(e>>>=0,this.ensure(5),e<128)this.u8[this.pos++]=e;else if(e<16384)this.u8[this.pos]=127&e|128,this.u8[this.pos+1]=e>>>7,this.pos=this.pos+2|0;else{let t=this.pos;for(;this.u8[t++]=127&e|128,128<=(e>>>=7););this.u8[t++]=e,this.pos=t}}writePackedArray(e,t){var i=0|e.length,r=(this.writeVarint(i),0|Ne[t]);if(!r)throw new Error("Unknown element type: 0x"+t.toString(16));switch(this.alignPos(Math.min(r,8)),this.ensure(i*r),t){case Q:new Int8Array(this.buffer,this.pos,i).set(e),this.pos=this.pos+i|0;break;case Y:var s=new Int16Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)s[t]=0|e[t];this.pos=this.pos+(i<<1)|0;break;case J:var a=new Int32Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)a[t]=0|e[t];this.pos=this.pos+(i<<2)|0;break;case X:var n=new Float32Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)n[t]=+e[t];this.pos=this.pos+(i<<2)|0;break;case Z:var o=new Float64Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)o[t]=+e[t];this.pos=this.pos+(i<<3)|0;break;default:throw new Error("Unsupported packed array type: 0x"+t.toString(16))}}writeBulkAligned(e,t){var i;t=Math.min(t,8),this.alignPos(t),t=e.byteLength||e.length;this.ensure(t),e.buffer&&void 0!==e.byteOffset?(i=new Uint8Array(e.buffer,e.byteOffset,t),this.u8.set(i,this.pos)):this.u8.set(e,this.pos),this.pos=this.pos+t|0}reset(){this.pos=0}getResult(){return this.u8.subarray(0,this.pos)}}class Ze{constructor(){this.blockSize=16}canOptimize(e){var t=e.length;if(!(8<=t&(0==(t&t-1)||16<=t)))return!1;var i=typeof e[0];if("number"!=i)return!1;var r=Math.max(1,t>>>5|0);for(let s=r;s<t;s+=r)if(typeof e[s]!=i)return!1;return!0}analyzeNumericArray(e){let t=1,i=1/0,r=-1/0,s=1;var a,n=e.length;for(let a=0;a<n;a++){var o=e[a];t&=+(o==(0|o)),i=Math.min(i,o),r=Math.max(r,o),s&&(s&=+(Math.fround(o)==o))}return t?(a=+((a=Math.max(Math.abs(i),Math.abs(r)))<=127)<<0|+(a<=32767)<<1|+(a<=2147483647)<<2,[{type:J,elementSize:4},{type:Q,elementSize:1},{type:Y,elementSize:2},{type:J,elementSize:4}][3&a]):s?{type:X,elementSize:4}:{type:Z,elementSize:8}}}class et{constructor(e={}){this.simdProcessor=new Ze,this.allowFunction=e.allowFunction||!1,this.constructorMap=new Map,this.typeNameMap=new Map,this.errorTypeMap=new Map,this.initMaps()}initMaps(){var e,t,i,r,s=[[Date,xe],[RegExp,Be],[Map,be],[Set,Ae],[ArrayBuffer,me],[DataView,we]],a=[["Uint8Array",ne],["Int8Array",oe],["Uint8ClampedArray",he],["Uint16Array",ce],["Int16Array",le],["Uint32Array",de],["Int32Array",ue],["Float32Array",_e],["Float64Array",fe],["BigInt64Array",pe],["BigUint64Array",ye],["SharedArrayBuffer",ve]];for([e,t]of s)this.constructorMap.set(e,t);for([i,r]of a){var n=globalThis[i];n&&(this.constructorMap.set(n,r),this.typeNameMap.set(i,r))}this.errorTypeMap.set("Error",ke),this.errorTypeMap.set("EvalError",ze),this.errorTypeMap.set("RangeError",Ie),this.errorTypeMap.set("ReferenceError",Ee),this.errorTypeMap.set("SyntaxError",Ue),this.errorTypeMap.set("TypeError",Ce),this.errorTypeMap.set("URIError",De),this.errorTypeMap.set("AggregateError",Me)}detect(e){if(null==e)return null===e?g:v;switch(typeof e){case"boolean":return e?A:b;case"number":return this.detectNumber(e);case"bigint":return this.detectBigInt(e);case"string":return this.detectString(e);case"symbol":return this.detectSymbol(e);case"object":return this.detectObject(e);default:return v}}detectNumber(e){var t,i,r;return e!=e?U:(r=new Float64Array([e]),((t=(r=new Uint32Array(r.buffer))[1])&(i=2146435072))==i&0==r[0]&0==(1048575&t)?t>>>31?D:C:0==e&&t>>>31?M:e==(0|e)?(r=+((i=Math.abs(e))<=127)<<0|+(i<=32767)<<1|+(i<=2147483647)<<2,[T,x,S,k][Math.min(r,3)]):Math.fround(e)==e?I:E)}detectBigInt(e){var t=e<0n;return(t?-e:e)<=0x7fffffffffffffffn?t?V:B:t?P:L}detectString(e){var t,i=e.length;if(0==i)return O;let r=1;for(let t=0;t<i&&r;t++)r&=+(e.charCodeAt(t)<=127);return r?i<16?F:i<256?K:R:(t=(new TextEncoder).encode(e).length)<16?q:t<256?$:j}detectSymbol(e){return void 0!==Symbol.keyFor(e)?Ke:He.has(e)?Re:void 0===e.description?qe:Fe}detectObject(e){var t,i;return null==e?g:(t=e.constructor,void 0!==(t=this.constructorMap.get(t))?t==xe?(i=e.getTime())==i?xe:Se:t:Array.isArray(e)?this.detectArray(e):ArrayBuffer.isView(e)?this.detectTypedArrayType(e):e instanceof Error?this.detectErrorType(e):"undefined"!=typeof Blob&&e instanceof Blob?e instanceof File?Le:Ve:this.classifyObject(e))}classifyObject(e){var t=Object.getPrototypeOf(e);if(e.constructor!=Object&&t!=Object.prototype&&null!=t)return re;t=Object.getOwnPropertyNames(e);var i,r=Object.getOwnPropertySymbols(e);if(0===(t=[...t,...r]).length)return ee;let s=!1,a=!1;for(i of t){var n=Object.getOwnPropertyDescriptor(e,i);if(n.get||n.set){s=!0;break}"function"==typeof n.value&&this.allowFunction&&(a=!0),n.enumerable&&n.writable&&n.configurable||(s=!0)}return s?se:a?ae:ie}detectArray(e){var t=e.length;if(0==t)return H;let i=0,r=!1;for(let s=0;s<t;s++)s in e?i++:r=!0;return r||i<3*t>>>2?W:this.simdProcessor.canOptimize(e)?this.simdProcessor.analyzeNumericArray(e).type:G}detectTypedArrayType(e){return e=e.constructor.name,this.typeNameMap.get(e)||ne}detectErrorType(e){return e=e.constructor.name,this.errorTypeMap.get(e)||Te}}var tt=i(0),it=i.n(tt);i.d(t,"LacertaDB",(function(){return Bt})),i.d(t,"Database",(function(){return Tt})),i.d(t,"Collection",(function(){return Mt})),i.d(t,"Document",(function(){return St})),i.d(t,"MigrationManager",(function(){return Ct})),i.d(t,"PerformanceMonitor",(function(){return Dt})),i.d(t,"LacertaDBError",(function(){return ht})),i.d(t,"OPFSUtility",(function(){return At})),i.d(t,"IndexManager",(function(){return bt})),i.d(t,"CacheStrategy",(function(){return ut})),i.d(t,"LRUCache",(function(){return ct})),i.d(t,"LFUCache",(function(){return lt})),i.d(t,"TTLCache",(function(){return dt})),i.d(t,"BTreeIndex",(function(){return mt})),i.d(t,"TextIndex",(function(){return gt})),i.d(t,"GeoIndex",(function(){return vt})),i.d(t,"SecureDatabaseEncryption",(function(){return pt})),i.d(t,"QuickStore",(function(){return st})),i.d(t,"AsyncMutex",(function(){return ot})),i.d(t,"IndexedDBConnectionPool",(function(){return at})),i.d(t,"BrowserCompressionUtility",(function(){return _t})),i.d(t,"BrowserEncryptionUtility",(function(){return ft})),
|
|
2
2
|
/**
|
|
3
|
-
* LacertaDB V0.11.
|
|
3
|
+
* LacertaDB V0.11.3 - Production Library
|
|
4
4
|
* @module LacertaDB
|
|
5
|
-
* @version 0.11.
|
|
5
|
+
* @version 0.11.3
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @author Pixagram SA
|
|
8
8
|
*/
|
package/dist/index.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(e=>{var t={};function i(r){var s;return(t[r]||(s=t[r]={i:r,l:!1,exports:{}},e[r].call(s.exports,s,s.exports,i),s.l=!0,s)).exports}i.m=e,i.c=t,i.d=function(e,t,r){i.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},i.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var s in e)i.d(r,s,function(t){return e[t]}.bind(null,s));return r},i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,"a",t),t},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},i.p="",i(i.s=1)})([function(e,t){var i={},r=new Float32Array(4);function s(e,t){if((0|e)!==e)throw new TypeError("Lane index must be an int32");if(e<0||t<=e)throw new RangeError("Lane index must be in bounds")}new Int32Array(r.buffer),new Int16Array(r.buffer),new Int8Array(r.buffer),new Uint32Array(r.buffer),new Uint16Array(r.buffer),new Uint8Array(r.buffer),void 0!==i.Int8x16&&void 0!==i.Int8x16.extractLane||(i.Int8x16=function(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y){if(!(this instanceof i.Int8x16))return new i.Int8x16(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y);this.s_=new Int8Array([e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y])},i.Int8x16.check=function(e){if(e instanceof i.Int8x16)return e;throw new TypeError("Argument is not a Int8x16.")},i.Int8x16.splat=function(e){return new i.Int8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Int8x16.extractLane=function(e,t){return e=i.Int8x16.check(e),s(t,16),e.s_[t]},i.Int8x16.replaceLane=function(e,t,r){return e=i.Int8x16.check(e),s(t,16),(e=Array.from(e.s_))[t]=r,new i.Int8x16(...e)},i.Int8x16.shuffle=function(e,t,r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g){var v=[r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g],b=[];e=i.Int8x16.check(e),t=i.Int8x16.check(t);for(var A=0;A<16;A++){var x=v[A];s(x,32),b[A]=x<16?e.s_[x]:t.s_[x-16]}return new i.Int8x16(...b)}),void 0!==i.Uint8x16&&void 0!==i.Uint8x16.extractLane||(i.Uint8x16=function(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y){if(!(this instanceof i.Uint8x16))return new i.Uint8x16(e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y);this.s_=new Uint8Array([e,t,r,s,a,n,o,h,c,l,d,u,_,f,p,y])},i.Uint8x16.check=function(e){if(e instanceof i.Uint8x16)return e;throw new TypeError("Argument is not a Uint8x16.")},i.Uint8x16.splat=function(e){return new i.Uint8x16(e,e,e,e,e,e,e,e,e,e,e,e,e,e,e,e)},i.Uint8x16.extractLane=function(e,t){return e=i.Uint8x16.check(e),s(t,16),e.s_[t]},i.Uint8x16.load=function(e,t){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return new i.Uint8x16(...e.subarray(t,t+16))},i.Uint8x16.store=function(e,t,i){if(t<0||t*e.BYTES_PER_ELEMENT+16>e.byteLength)throw new RangeError("The value of index is invalid.");return e.set(i.s_,t),i},i.Uint8x16.shuffle=function(e,t,r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g){var v=[r,a,n,o,h,c,l,d,u,_,f,p,y,w,m,g],b=[];e=i.Uint8x16.check(e),t=i.Uint8x16.check(t);for(var A=0;A<16;A++){var x=v[A];s(x,32),b[A]=x<16?e.s_[x]:t.s_[x-16]}return new i.Uint8x16(...b)},i.Uint8x16.and=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]&t.s_[s];return new i.Uint8x16(...r)},i.Uint8x16.or=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]|t.s_[s];return new i.Uint8x16(...r)},i.Uint8x16.shiftLeftByScalar=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]<<t;return new i.Uint8x16(...r)},i.Uint8x16.shiftRightByScalar=function(e,t){for(var r=[],s=0;s<16;++s)r[s]=e.s_[s]>>>t;return new i.Uint8x16(...r)}),e.exports=class{constructor(){this.ENC_SHUFFLE=i.Int8x16(10,11,9,10,7,8,6,7,4,5,3,4,1,2,0,1),this.ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.ENC_LUT_SIMD=[i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0),i.Uint8x16.splat(0)];for(let t=0;t<4;t++){var e=this.ENC_LUT.substring(16*t,16*(t+1));this.ENC_LUT_SIMD[t]=i.Uint8x16(...Array.from(e).map(e=>e.charCodeAt(0)))}this.DEC_DELTA_ASSO=i.Uint8x16(1,1,1,1,1,1,1,1,0,0,0,0,0,15,0,15),this.DEC_DELTA_VALUES=i.Int8x16(0,0,0,19,4,191,191,185,185,0,16,195,191,191,185,185),this.DEC_SHUFFLE=i.Int8x16(-1,-1,-1,-1,12,13,14,8,9,10,4,5,6,0,1,2),this.SCALAR_ENC_LUT="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",this.SCALAR_DEC_LUT={};for(let e=0;e<this.SCALAR_ENC_LUT.length;e++)this.SCALAR_DEC_LUT[this.SCALAR_ENC_LUT.charAt(e)]=e;this.SCALAR_DEC_LUT["="]=0}_scalar_encode(e){let t="";for(let a=0;a<e.length;a+=3){var i=e[a],r=a+1<e.length?e[a+1]:0,s=a+2<e.length?e[a+2]:0;t+=this.SCALAR_ENC_LUT[i>>2]+this.SCALAR_ENC_LUT[(3&i)<<4|r>>4],a+1<e.length?t+=this.SCALAR_ENC_LUT[(15&r)<<2|s>>6]:t+="=",a+2<e.length?t+=this.SCALAR_ENC_LUT[63&s]:t+="="}return t}encode(e){var t=e.length,i=4*Math.ceil(t/3),r=new Uint8Array(i);let s=0,a=0;for(;s+12<=t;){var n=e.subarray(s,s+12),o=new Uint8Array(16);o[0]=n[0]>>2,o[1]=(3&n[0])<<4|n[1]>>4,o[2]=(15&n[1])<<2|n[2]>>6,o[3]=63&n[2],o[4]=n[3]>>2,o[5]=(3&n[3])<<4|n[4]>>4,o[6]=(15&n[4])<<2|n[5]>>6,o[7]=63&n[5],o[8]=n[6]>>2,o[9]=(3&n[6])<<4|n[7]>>4,o[10]=(15&n[7])<<2|n[8]>>6,o[11]=63&n[8],o[12]=n[9]>>2,o[13]=(3&n[9])<<4|n[10]>>4,o[14]=(15&n[10])<<2|n[11]>>6,o[15]=63&n[11];for(let e=0;e<16;e++)r[a+e]=this.SCALAR_ENC_LUT.charCodeAt(o[e]);s+=12,a+=16}let h=(new TextDecoder).decode(r.subarray(0,a));return s<t&&(h+=this._scalar_encode(e.subarray(s))),h}_scalar_decode(e){e=e.replace(/=+$/,"");var t=Math.floor(3*e.length/4),i=new Uint8Array(t);let r=0;for(let h=0;h<e.length;h+=4){var s=this.SCALAR_DEC_LUT[e[h]],a=this.SCALAR_DEC_LUT[e[h+1]],n=h+2<e.length?this.SCALAR_DEC_LUT[e[h+2]]:0,o=h+3<e.length?this.SCALAR_DEC_LUT[e[h+3]]:0;i[r++]=s<<2|a>>4,r<t&&(i[r++]=(15&a)<<4|n>>2),r<t&&(i[r++]=(3&n)<<6|o)}return i}decode(e){var t=e.length;if(t%4!=0)throw new Error("Invalid Base64 string length.");var i=(e.match(/=/g)||[]).length,r=new Uint8Array(3*t/4-i);let s=0,a=0;for(var n;s+16<=t-i;){var o=Array.from(e.substring(s,s+16)).map(e=>this.SCALAR_DEC_LUT[e]),h=new Uint8Array(12);h[0]=o[0]<<2|o[1]>>4,h[1]=(15&o[1])<<4|o[2]>>2,h[2]=(3&o[2])<<6|o[3],h[3]=o[4]<<2|o[5]>>4,h[4]=(15&o[5])<<4|o[6]>>2,h[5]=(3&o[6])<<6|o[7],h[6]=o[8]<<2|o[9]>>4,h[7]=(15&o[9])<<4|o[10]>>2,h[8]=(3&o[10])<<6|o[11],h[9]=o[12]<<2|o[13]>>4,h[10]=(15&o[13])<<4|o[14]>>2,h[11]=(3&o[14])<<6|o[15],r.set(h,a),s+=16,a+=12}return s<t&&(n=this._scalar_decode(e.substring(s)),r.set(n,a)),r}}},function(e,t,i){i.r(t);let r=240,s=0,a=16,n=32,o=48,h=64,c=80,l=96,d=112,u=128,_=144,f=160,p=176,y=192,w=224,m=240,g=0,v=1,b=2,A=3,x=16,S=17,k=18,z=19,I=20,E=21,U=22,D=23,C=24,M=25,T=26,B=32,V=33,L=34,P=35,O=48,F=49,K=50,R=51,q=52,$=53,j=54,N=55,H=64,G=65,W=66,Q=67,Y=68,J=69,X=70,Z=71,ee=80,te=81,ie=82,re=83,se=84,ae=85,ne=96,oe=97,he=98,ce=99,le=100,de=101,ue=102,_e=103,fe=104,pe=105,ye=106,we=107,me=112,ge=113,ve=114,be=128,Ae=129,xe=144,Se=145,ke=160,ze=161,Ie=162,Ee=163,Ue=164,De=165,Ce=166,Me=167,Te=168,Be=176,Ve=192,Le=193,Pe=208,Oe=209,Fe=224,Ke=225,Re=226,qe=227,$e=240,je=new Uint8Array(256),Ne=new Uint8Array(256);new Map;let He=new Map,Ge=new Map;var We=[[S,2],[k,4],[z,4],[I,4],[E,8],[B,8],[V,8]];for(let e=0;e<We.length;e++)je[We[e][0]]=We[e][1];var Qe,Ye=[[ne,1],[oe,1],[he,1],[ce,2],[le,2],[de,4],[ue,4],[_e,4],[fe,8],[pe,8],[ye,8],[Q,1],[Y,2],[J,4],[X,4],[Z,8]];for(let e=0;e<Ye.length;e++)Ne[Ye[e][0]]=Ye[e][1];for(Qe of["asyncIterator","hasInstance","isConcatSpreadable","iterator","match","matchAll","replace","search","species","split","toPrimitive","toStringTag","unscopables"]){var Je=Symbol[Qe];Je&&(He.set(Je,Qe),Ge.set(Qe,Je))}class Xe{constructor(e=65536){this.size=(e+128-1&-128)>>>0,this.buffer=new ArrayBuffer(this.size),this.offset=0,this.u8=new Uint8Array(this.buffer),this.view=new DataView(this.buffer),this.pos=0,this.f32View=null,this.f64View=null,this.i32View=null}ensure(e){var t,i;(e=this.pos+(e|=0)|0)>this.size&&(e=(128+(0|Math.max(this.size<<1,128+e))-1&-128)>>>0,t=new ArrayBuffer(e),(i=new Uint8Array(t)).set(this.u8.subarray(0,this.pos)),this.buffer=t,this.u8=i,this.view=new DataView(t),this.size=e,this.f32View=null,this.f64View=null,this.i32View=null)}alignPos(e){e=e-1|0,this.pos=(this.pos+e&~e)>>>0}writeU8(e){this.ensure(1),this.u8[this.pos++]=255&e}writeU16(e){this.alignPos(2),this.ensure(2),this.view.setUint16(this.pos,65535&e,!0),this.pos=this.pos+2|0}writeI16(e){this.alignPos(2),this.ensure(2),this.view.setInt16(this.pos,e,!0),this.pos=this.pos+2|0}writeU32(e){this.alignPos(4),this.ensure(4),this.view.setUint32(this.pos,e>>>0,!0),this.pos=this.pos+4|0}writeI32(e){this.alignPos(4),this.ensure(4),this.view.setInt32(this.pos,0|e,!0),this.pos=this.pos+4|0}writeF32(e){this.alignPos(4),this.ensure(4),this.view.setFloat32(this.pos,+e,!0),this.pos=this.pos+4|0}writeF64(e){this.alignPos(8),this.ensure(8),this.view.setFloat64(this.pos,+e,!0),this.pos=this.pos+8|0}writeBigInt64(e){this.alignPos(8),this.ensure(8),this.view.setBigInt64(this.pos,BigInt(e),!0),this.pos=this.pos+8|0}writeVarint(e){if(e>>>=0,this.ensure(5),e<128)this.u8[this.pos++]=e;else if(e<16384)this.u8[this.pos]=127&e|128,this.u8[this.pos+1]=e>>>7,this.pos=this.pos+2|0;else{let t=this.pos;for(;this.u8[t++]=127&e|128,128<=(e>>>=7););this.u8[t++]=e,this.pos=t}}writePackedArray(e,t){var i=0|e.length,r=(this.writeVarint(i),0|Ne[t]);if(!r)throw new Error("Unknown element type: 0x"+t.toString(16));switch(this.alignPos(Math.min(r,8)),this.ensure(i*r),t){case Q:new Int8Array(this.buffer,this.pos,i).set(e),this.pos=this.pos+i|0;break;case Y:var s=new Int16Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)s[t]=0|e[t];this.pos=this.pos+(i<<1)|0;break;case J:var a=new Int32Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)a[t]=0|e[t];this.pos=this.pos+(i<<2)|0;break;case X:var n=new Float32Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)n[t]=+e[t];this.pos=this.pos+(i<<2)|0;break;case Z:var o=new Float64Array(this.buffer,this.pos,i);for(let t=0;t<i;t++)o[t]=+e[t];this.pos=this.pos+(i<<3)|0;break;default:throw new Error("Unsupported packed array type: 0x"+t.toString(16))}}writeBulkAligned(e,t){var i;t=Math.min(t,8),this.alignPos(t),t=e.byteLength||e.length;this.ensure(t),e.buffer&&void 0!==e.byteOffset?(i=new Uint8Array(e.buffer,e.byteOffset,t),this.u8.set(i,this.pos)):this.u8.set(e,this.pos),this.pos=this.pos+t|0}reset(){this.pos=0}getResult(){return this.u8.subarray(0,this.pos)}}class Ze{constructor(){this.blockSize=16}canOptimize(e){var t=e.length;if(!(8<=t&(0==(t&t-1)||16<=t)))return!1;var i=typeof e[0];if("number"!=i)return!1;var r=Math.max(1,t>>>5|0);for(let s=r;s<t;s+=r)if(typeof e[s]!=i)return!1;return!0}analyzeNumericArray(e){let t=1,i=1/0,r=-1/0,s=1;var a,n=e.length;for(let a=0;a<n;a++){var o=e[a];t&=+(o==(0|o)),i=Math.min(i,o),r=Math.max(r,o),s&&(s&=+(Math.fround(o)==o))}return t?(a=+((a=Math.max(Math.abs(i),Math.abs(r)))<=127)<<0|+(a<=32767)<<1|+(a<=2147483647)<<2,[{type:J,elementSize:4},{type:Q,elementSize:1},{type:Y,elementSize:2},{type:J,elementSize:4}][3&a]):s?{type:X,elementSize:4}:{type:Z,elementSize:8}}}class et{constructor(e={}){this.simdProcessor=new Ze,this.allowFunction=e.allowFunction||!1,this.constructorMap=new Map,this.typeNameMap=new Map,this.errorTypeMap=new Map,this.initMaps()}initMaps(){var e,t,i,r,s=[[Date,xe],[RegExp,Be],[Map,be],[Set,Ae],[ArrayBuffer,me],[DataView,we]],a=[["Uint8Array",ne],["Int8Array",oe],["Uint8ClampedArray",he],["Uint16Array",ce],["Int16Array",le],["Uint32Array",de],["Int32Array",ue],["Float32Array",_e],["Float64Array",fe],["BigInt64Array",pe],["BigUint64Array",ye],["SharedArrayBuffer",ve]];for([e,t]of s)this.constructorMap.set(e,t);for([i,r]of a){var n=globalThis[i];n&&(this.constructorMap.set(n,r),this.typeNameMap.set(i,r))}this.errorTypeMap.set("Error",ke),this.errorTypeMap.set("EvalError",ze),this.errorTypeMap.set("RangeError",Ie),this.errorTypeMap.set("ReferenceError",Ee),this.errorTypeMap.set("SyntaxError",Ue),this.errorTypeMap.set("TypeError",De),this.errorTypeMap.set("URIError",Ce),this.errorTypeMap.set("AggregateError",Me)}detect(e){if(null==e)return null===e?g:v;switch(typeof e){case"boolean":return e?A:b;case"number":return this.detectNumber(e);case"bigint":return this.detectBigInt(e);case"string":return this.detectString(e);case"symbol":return this.detectSymbol(e);case"object":return this.detectObject(e);default:return v}}detectNumber(e){var t,i,r;return e!=e?U:(r=new Float64Array([e]),((t=(r=new Uint32Array(r.buffer))[1])&(i=2146435072))==i&0==r[0]&0==(1048575&t)?t>>>31?C:D:0==e&&t>>>31?M:e==(0|e)?(r=+((i=Math.abs(e))<=127)<<0|+(i<=32767)<<1|+(i<=2147483647)<<2,[T,x,S,k][Math.min(r,3)]):Math.fround(e)==e?I:E)}detectBigInt(e){var t=e<0n;return(t?-e:e)<=0x7fffffffffffffffn?t?V:B:t?P:L}detectString(e){var t,i=e.length;if(0==i)return O;let r=1;for(let t=0;t<i&&r;t++)r&=+(e.charCodeAt(t)<=127);return r?i<16?F:i<256?K:R:(t=(new TextEncoder).encode(e).length)<16?q:t<256?$:j}detectSymbol(e){return void 0!==Symbol.keyFor(e)?Ke:He.has(e)?Re:void 0===e.description?qe:Fe}detectObject(e){var t,i;return null==e?g:(t=e.constructor,void 0!==(t=this.constructorMap.get(t))?t==xe?(i=e.getTime())==i?xe:Se:t:Array.isArray(e)?this.detectArray(e):ArrayBuffer.isView(e)?this.detectTypedArrayType(e):e instanceof Error?this.detectErrorType(e):"undefined"!=typeof Blob&&e instanceof Blob?e instanceof File?Le:Ve:this.classifyObject(e))}classifyObject(e){var t=Object.getPrototypeOf(e);if(e.constructor!=Object&&t!=Object.prototype&&null!=t)return re;t=Object.getOwnPropertyNames(e);var i,r=Object.getOwnPropertySymbols(e);if(0===(t=[...t,...r]).length)return ee;let s=!1,a=!1;for(i of t){var n=Object.getOwnPropertyDescriptor(e,i);if(n.get||n.set){s=!0;break}"function"==typeof n.value&&this.allowFunction&&(a=!0),n.enumerable&&n.writable&&n.configurable||(s=!0)}return s?se:a?ae:ie}detectArray(e){var t=e.length;if(0==t)return H;let i=0,r=!1;for(let s=0;s<t;s++)s in e?i++:r=!0;return r||i<3*t>>>2?W:this.simdProcessor.canOptimize(e)?this.simdProcessor.analyzeNumericArray(e).type:G}detectTypedArrayType(e){return e=e.constructor.name,this.typeNameMap.get(e)||ne}detectErrorType(e){return e=e.constructor.name,this.errorTypeMap.get(e)||Te}}var tt=i(0),it=i.n(tt);i.d(t,"LacertaDB",(function(){return Bt})),i.d(t,"Database",(function(){return Tt})),i.d(t,"Collection",(function(){return Mt})),i.d(t,"Document",(function(){return St})),i.d(t,"MigrationManager",(function(){return Dt})),i.d(t,"PerformanceMonitor",(function(){return Ct})),i.d(t,"LacertaDBError",(function(){return ht})),i.d(t,"OPFSUtility",(function(){return At})),i.d(t,"IndexManager",(function(){return bt})),i.d(t,"CacheStrategy",(function(){return ut})),i.d(t,"LRUCache",(function(){return ct})),i.d(t,"LFUCache",(function(){return lt})),i.d(t,"TTLCache",(function(){return dt})),i.d(t,"BTreeIndex",(function(){return mt})),i.d(t,"TextIndex",(function(){return gt})),i.d(t,"GeoIndex",(function(){return vt})),i.d(t,"SecureDatabaseEncryption",(function(){return pt})),i.d(t,"QuickStore",(function(){return st})),i.d(t,"AsyncMutex",(function(){return ot})),i.d(t,"IndexedDBConnectionPool",(function(){return at})),i.d(t,"BrowserCompressionUtility",(function(){return _t})),i.d(t,"BrowserEncryptionUtility",(function(){return ft})),
|
|
2
2
|
/**
|
|
3
|
-
* LacertaDB V0.11.
|
|
3
|
+
* LacertaDB V0.11.3 - Production Library
|
|
4
4
|
* @module LacertaDB
|
|
5
|
-
* @version 0.11.
|
|
5
|
+
* @version 0.11.3
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @author Pixagram SA
|
|
8
8
|
*/
|
package/index.js
CHANGED
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/pixagram-blockchain/LacertaDB/main/logo.webp?raw=true" alt="LacertaDB Logo" width="
|
|
2
|
+
<img src="https://raw.githubusercontent.com/pixagram-blockchain/LacertaDB/main/logo.webp?raw=true" alt="LacertaDB Logo" width="800"/>
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
|
-
<h1 align="center">LacertaDB 0.11.
|
|
5
|
+
<h1 align="center">LacertaDB 0.11.3</h1>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
8
|
<strong>A high-performance, browser-native document database with encryption, indexing, and MongoDB-like queries.</strong>
|