const pako = require ( 'pako' ) ; const base91 = require ( 'node-base91' ) ; export function decompressTileCode ( tileCodeString ) { if ( typeof tileCodeString === 'string' ) { if ( tileCodeString . startsWith ( 'b#' ) ) { try { return pako . inflate ( base91 . decode ( tileCodeString . substr ( 2 ) ) , { to : 'string' , } ) ; } catch { console . log ( 'Unable to deflate' ) ; return '' ; } } else { return tileCodeString . trim ( ) ; } } return tileCodeString . trim ( ) ; }