@@ -54,6 +54,23 @@ class RoaringBitmap {
5454 }
5555 this . consumed_len_bytes = pspecial - i ;
5656 return this ;
57+ } else if ( u8array [ i ] > 0xe0 ) {
58+ // Special representation of tiny sets that are runs
59+ const lspecial = u8array [ i ] & 0x0f ;
60+ this . keysAndCardinalities = new Uint8Array ( lspecial * 4 ) ;
61+ i += 1 ;
62+ const key = u8array [ i + 2 ] | ( u8array [ i + 3 ] << 8 ) ;
63+ const value = u8array [ i ] | ( u8array [ i + 1 ] << 8 ) ;
64+ const container = new RoaringBitmapRun ( 1 , new Uint8Array ( 4 ) ) ;
65+ container . array [ 0 ] = value & 0xFF ;
66+ container . array [ 1 ] = ( value >> 8 ) & 0xFF ;
67+ container . array [ 2 ] = lspecial - 1 ;
68+ this . containers . push ( container ) ;
69+ this . keysAndCardinalities [ 0 ] = key & 0xFF ;
70+ this . keysAndCardinalities [ 1 ] = ( key >> 8 ) & 0xFF ;
71+ this . keysAndCardinalities [ 2 ] = lspecial - 1 ;
72+ this . consumed_len_bytes = 5 ;
73+ return this ;
5774 } else if ( u8array [ i ] < 0x3a ) {
5875 // Special representation of tiny sets with arbitrary 32-bit integers
5976 const lspecial = u8array [ i ] ;
@@ -2282,7 +2299,7 @@ function loadDatabase(hooks) {
22822299 */
22832300 class InlineNeighborsTree {
22842301 /**
2285- * @param {Uint8Array<ArrayBuffer> } encoded
2302+ * @param {Uint8Array } encoded
22862303 * @param {number } start
22872304 */
22882305 constructor (
@@ -2654,7 +2671,7 @@ function loadDatabase(hooks) {
26542671
26552672 /**
26562673 * @param {string } inputBase64
2657- * @returns {[Uint8Array<ArrayBuffer> , SearchTree] }
2674+ * @returns {[Uint8Array, SearchTree] }
26582675 */
26592676 function makeSearchTreeFromBase64 ( inputBase64 ) {
26602677 const input = makeUint8ArrayFromBase64 ( inputBase64 ) ;
@@ -3305,7 +3322,7 @@ if (typeof window !== "undefined") {
33053322// eslint-disable-next-line max-len
33063323// polyfill https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array/fromBase64
33073324/**
3308- * @type {function(string): Uint8Array<ArrayBuffer> } base64
3325+ * @type {function(string): Uint8Array } base64
33093326 */
33103327//@ts -expect-error
33113328const makeUint8ArrayFromBase64 = Uint8Array . fromBase64 ? Uint8Array . fromBase64 : ( string => {
@@ -3318,7 +3335,7 @@ const makeUint8ArrayFromBase64 = Uint8Array.fromBase64 ? Uint8Array.fromBase64 :
33183335 return bytes ;
33193336} ) ;
33203337/**
3321- * @type {function(string): Uint8Array<ArrayBuffer> } base64
3338+ * @type {function(string): Uint8Array } base64
33223339 */
33233340//@ts -expect-error
33243341const makeUint8ArrayFromHex = Uint8Array . fromHex ? Uint8Array . fromHex : ( string => {
0 commit comments